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

/* Variables and functions */
float mat44_at(struct mat44 *, int, int);
float mat44_get_znear(struct mat44 *m) {
  float c = mat44_at(m, 2, 2);
  float k = (c - 1.0f) / (c + 1.0f);
  float d = mat44_at(m, 3, 2);
  return (d * (1.0f - k)) / (2.0f * k);
}


x86 assembly (clang, -O0):
<mat44_get_znear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2,%edx
mov    %edx,%esi
call   1030 <mat44_at@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xec6(%rip),%xmm1
subss  %xmm1,%xmm0
movss  0xeba(%rip),%xmm1
addss  -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
mov    $0x2,%edx
call   1030 <mat44_at@plt>
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  0xe87(%rip),%xmm1
subss  -0x10(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xe72(%rip),%xmm1
mulss  -0x10(%rbp),%xmm1
divss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mat44_get_znear>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    $0x2,%esi
mov    $0x2,%edx
call   1030 <mat44_at@plt>
movss  0xed1(%rip),%xmm1
addss  %xmm0,%xmm1
addss  0xec9(%rip),%xmm0
divss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x2,%edx
call   1030 <mat44_at@plt>
movss  0xc(%rsp),%xmm1
movss  0xe9f(%rip),%xmm2
subss  %xmm1,%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm1
divss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.mat44 = type { i32 }
define float @mat44_get_znear(%struct.mat44* %0) {
%2 = alloca %struct.mat44*
%3 = alloca float
%4 = alloca float
%5 = alloca float
store %struct.mat44* %0, %struct.mat44** %2
%6 = load %struct.mat44*, %struct.mat44** %2
%7 = call float @mat44_at(%struct.mat44* %6, i32 2, i32 2)
store float %7, float* %3
%8 = load float, float* %3
%9 = fsub float %8, 1.000000e+00
%10 = load float, float* %3
%11 = fadd float %10, 1.000000e+00
%12 = fdiv float %9, %11
store float %12, float* %4
%13 = load %struct.mat44*, %struct.mat44** %2
%14 = call float @mat44_at(%struct.mat44* %13, i32 3, i32 2)
store float %14, float* %5
%15 = load float, float* %5
%16 = load float, float* %4
%17 = fsub float 1.000000e+00, %16
%18 = fmul float %15, %17
%19 = load float, float* %4
%20 = fmul float 2.000000e+00, %19
%21 = fdiv float %18, %20
ret float %21
}

LLVM IR (-O2):
%struct.mat44 = type { i32 }
define float @mat44_get_znear(%struct.mat44* %0) {
%2 = tail call float @mat44_at(%struct.mat44* %0, i32 2, i32 2)
%3 = fadd float %2, -1.000000e+00
%4 = fadd float %2, 1.000000e+00
%5 = fdiv float %3, %4
%6 = tail call float @mat44_at(%struct.mat44* %0, i32 3, i32 2)
%7 = fsub float 1.000000e+00, %5
%8 = fmul float %6, %7
%9 = fmul float %5, 2.000000e+00
%10 = fdiv float %8, %9
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ si475x_set_property(int, int);
void si475xAMSWLWRX_regional_cfg(void) {
  si475x_set_property(0x1102, 5);
  si475x_set_property(0x1100, 4750);
  si475x_set_property(0x1101, 5060);
}


x86 assembly (clang, -O0):
<si475xAMSWLWRX_regional_cfg>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1102,%edi
mov    $0x5,%esi
call   1030 <si475x_set_property@plt>
mov    $0x1100,%edi
mov    $0x128e,%esi
call   1030 <si475x_set_property@plt>
mov    $0x1101,%edi
mov    $0x13c4,%esi
call   1030 <si475x_set_property@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<si475xAMSWLWRX_regional_cfg>:
push   %rax
mov    $0x1102,%edi
mov    $0x5,%esi
call   1030 <si475x_set_property@plt>
mov    $0x1100,%edi
mov    $0x128e,%esi
call   1030 <si475x_set_property@plt>
mov    $0x1101,%edi
mov    $0x13c4,%esi
pop    %rax
jmp    1030 <si475x_set_property@plt>

LLVM IR (-O0):
define void @si475xAMSWLWRX_regional_cfg() {
%1 = call i32 @si475x_set_property(i32 4354, i32 5)
%2 = call i32 @si475x_set_property(i32 4352, i32 4750)
%3 = call i32 @si475x_set_property(i32 4353, i32 5060)
ret void
}

LLVM IR (-O2):
define void @si475xAMSWLWRX_regional_cfg() {
%1 = tail call i32 @si475x_set_property(i32 4354, i32 5)
%2 = tail call i32 @si475x_set_property(i32 4352, i32 4750)
%3 = tail call i32 @si475x_set_property(i32 4353, i32 5060)
ret void
}
/* Type definitions */
struct c_queue_entry {
  int dummy;
};
struct c_queue {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ c_queue_add_entry(struct c_queue *, struct c_queue_entry *);
struct c_queue_entry *c_queue_entry_new(void *);
int c_queue_push(struct c_queue *queue, void *value) {
  struct c_queue_entry *entry;
  entry = c_queue_entry_new(value);
  if (!entry)
    return -1;
  c_queue_add_entry(queue, entry);
  return 0;
}


x86 assembly (clang, -O0):
<c_queue_push>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <c_queue_entry_new@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1154 <c_queue_push+0x34>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <c_queue_push+0x48>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <c_queue_add_entry@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_queue_push>:
push   %rbx
mov    %rdi,%rbx
mov    %rsi,%rdi
call   1040 <c_queue_entry_new@plt>
test   %rax,%rax
je     1140 <c_queue_push+0x20>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <c_queue_add_entry@plt>
xor    %eax,%eax
pop    %rbx
ret
mov    $0xffffffff,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.c_queue = type { i32 }
%struct.c_queue_entry = type { i32 }
define i32 @c_queue_push(%struct.c_queue* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.c_queue*
%5 = alloca i8*
%6 = alloca %struct.c_queue_entry*
store %struct.c_queue* %0, %struct.c_queue** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = call %struct.c_queue_entry* @c_queue_entry_new(i8* %7)
store %struct.c_queue_entry* %8, %struct.c_queue_entry** %6
%9 = load %struct.c_queue_entry*, %struct.c_queue_entry** %6
%10 = icmp ne %struct.c_queue_entry* %9, null
br i1 %10, label %12, label %11
11: ; preds = %2
store i32 -1, i32* %3
br label %16
12: ; preds = %2
%13 = load %struct.c_queue*, %struct.c_queue** %4
%14 = load %struct.c_queue_entry*, %struct.c_queue_entry** %6
%15 = call i32 @c_queue_add_entry(%struct.c_queue* %13, %struct.c_queue_entry* %14)
store i32 0, i32* %3
br label %16
16: ; preds = %12, %11
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.c_queue = type { i32 }
%struct.c_queue_entry = type { i32 }
define i32 @c_queue_push(%struct.c_queue* %0, i8* %1) {
%3 = tail call %struct.c_queue_entry* @c_queue_entry_new(i8* %1)
%4 = icmp eq %struct.c_queue_entry* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @c_queue_add_entry(%struct.c_queue* %0, %struct.c_queue_entry* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ F_GETFL;
int /*<<< orphan*/ F_SETFL;
int O_NONBLOCK;
int fcntl(int, int /*<<< orphan*/, int);
int setNonBlocking(int fd) {
  int flags;
  if (-1 == (flags = fcntl(fd, F_GETFL, 0))) {
    flags = 0;
  }
  return fcntl(fd, F_SETFL, flags | O_NONBLOCK);
}


x86 assembly (clang, -O0):
<setNonBlocking>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <fcntl@plt>
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1147 <setNonBlocking+0x37>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2e87(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
mov    0x2e8b(%rip),%rax
or     (%rax),%edx
call   1030 <fcntl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setNonBlocking>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
xor    %ebp,%ebp
xor    %edx,%edx
call   1030 <fcntl@plt>
cmp    $0xffffffff,%eax
cmovne %eax,%ebp
mov    0x2ea4(%rip),%rax
mov    (%rax),%esi
mov    0x2eab(%rip),%rax
or     (%rax),%ebp
mov    %ebx,%edi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <fcntl@plt>

LLVM IR (-O0):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @setNonBlocking(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* @F_GETFL
%6 = call i32 @fcntl(i32 %4, i32 %5, i32 0)
store i32 %6, i32* %3
%7 = icmp eq i32 -1, %6
br i1 %7, label %8, label %9
8: ; preds = %1
store i32 0, i32* %3
br label %9
9: ; preds = %8, %1
%10 = load i32, i32* %2
%11 = load i32, i32* @F_SETFL
%12 = load i32, i32* %3
%13 = load i32, i32* @O_NONBLOCK
%14 = or i32 %12, %13
%15 = call i32 @fcntl(i32 %10, i32 %11, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
@F_GETFL = global i32 0
@F_SETFL = global i32 0
@O_NONBLOCK = global i32 0
define i32 @setNonBlocking(i32 %0) {
%2 = load i32, i32* @F_GETFL
%3 = tail call i32 @fcntl(i32 %0, i32 %2, i32 0)
%4 = icmp eq i32 %3, -1
%5 = select i1 %4, i32 0, i32 %3
%6 = load i32, i32* @F_SETFL
%7 = load i32, i32* @O_NONBLOCK
%8 = or i32 %5, %7
%9 = tail call i32 @fcntl(i32 %0, i32 %6, i32 %8)
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
int main(void) {
  unsigned int x = 0x0ffffff1;
  while (x > 1) {
    x -= 2;
  }
  __VERIFIER_assert(!(x % 2));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffff1,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jbe    113e <main+0x2e>
mov    -0x8(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 268435441, i32* %2
br label %3
3: ; preds = %6, %0
%4 = load i32, i32* %2
%5 = icmp ugt i32 %4, 1
br i1 %5, label %6, label %9
6: ; preds = %3
%7 = load i32, i32* %2
%8 = sub i32 %7, 2
store i32 %8, i32* %2
br label %3
9: ; preds = %3
%10 = load i32, i32* %2
%11 = urem i32 %10, 2
%12 = icmp ne i32 %11, 0
%13 = xor i1 %12, true
%14 = zext i1 %13 to i32
%15 = call i32 @__VERIFIER_assert(i32 %14)
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @__VERIFIER_assert(i32 0)
ret i32 0
}
/* Variables and functions */
int foo(int *, int *);
int /*<<< orphan*/ printf(char *, int);
int rfoo(int *, int *);
int main() {
  int a = 1, b = 2;
  int *ptr_a, *ptr_b;
  ptr_a = &a, ptr_b = &b;
  printf("%d\n", foo(ptr_a, ptr_b));
  printf("%d\n", rfoo(ptr_a, ptr_b));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x1,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <foo@plt>
mov    %eax,%esi
lea    0xe94(%rip),%rdi
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <rfoo@plt>
mov    %eax,%esi
lea    0xe79(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x1,0xc(%rsp)
movl   $0x2,0x8(%rsp)
lea    0xc(%rsp),%r15
lea    0x8(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1050 <foo@plt>
lea    0xe9b(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1030 <rfoo@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 2, i32* %2
%5 = call i32 @foo(i32* %1, i32* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @rfoo(i32* %1, i32* %2)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}
void rop3_226_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = T ^ *D;
  stk2 = S & stk3;
  stk1 = *D ^ stk2;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_226_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
xor    %ecx,%eax
mov    %al,-0xd(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xd(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%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    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%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_226_1_1>:
ret

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

LLVM IR (-O2):
define void @rop3_226_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
ret void
}
void ScaleARGBRowDownEven_Any_SSE2() {}


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

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

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

LLVM IR (-O2):
define void @ScaleARGBRowDownEven_Any_SSE2() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_putchar(char);
void put_clm(char clm, char first, char mid, char last) {
  if (clm == 'f')
    ft_putchar(first);
  else if (clm == 'l')
    ft_putchar(last);
  else
    ft_putchar(mid);
}


x86 assembly (clang, -O0):
<put_clm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x66,%eax
jne    114a <put_clm+0x3a>
movsbl -0x2(%rbp),%edi
call   1030 <ft_putchar@plt>
jmp    1173 <put_clm+0x63>
movsbl -0x1(%rbp),%eax
cmp    $0x6c,%eax
jne    1165 <put_clm+0x55>
movsbl -0x4(%rbp),%edi
call   1030 <ft_putchar@plt>
jmp    116e <put_clm+0x5e>
movsbl -0x3(%rbp),%edi
call   1030 <ft_putchar@plt>
jmp    1173 <put_clm+0x63>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_clm>:
cmp    $0x66,%dil
je     1124 <put_clm+0x14>
cmp    $0x6c,%dil
jne    112e <put_clm+0x1e>
movsbl %cl,%edi
jmp    1030 <ft_putchar@plt>
mov    %esi,%ecx
movsbl %cl,%edi
jmp    1030 <ft_putchar@plt>
mov    %edx,%ecx
movsbl %cl,%edi
jmp    1030 <ft_putchar@plt>

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

LLVM IR (-O2):
define void @put_clm(i8 signext %0, i8 signext %1, i8 signext %2, i8 signext %3) {
switch i8 %0, label %6 [
i8 102, label %7
i8 108, label %5
]
5: ; preds = %4
br label %7
6: ; preds = %4
br label %7
7: ; preds = %4, %5, %6
%8 = phi i8 [ %3, %5 ], [ %2, %6 ], [ %1, %4 ]
%9 = tail call i32 @ft_putchar(i8 signext %8)
ret void
}
/* Variables and functions */
int get_line_length(const char *line) {
  int res = 0;
  while (*line != '\0' && *line != '\n') {
    line++;
    res++;
  }
  return res;
}


x86 assembly (clang, -O0):
<get_line_length>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0xd(%rbp)
je     1134 <get_line_length+0x34>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    1144 <get_line_length+0x44>
jmp    115e <get_line_length+0x5e>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <get_line_length+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_line_length>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rdi,%rax,1),%ecx
test   %cl,%cl
je     1123 <get_line_length+0x23>
cmp    $0xa,%cl
je     1123 <get_line_length+0x23>
add    $0x1,%rax
jmp    1110 <get_line_length+0x10>
ret

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

LLVM IR (-O2):
define i32 @get_line_length(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = phi i32 [ 0, %1 ], [ %8, %6 ]
%5 = load i8, i8* %3
switch i8 %5, label %6 [
i8 0, label %9
i8 10, label %9
]
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = add nuw nsw i32 %4, 1
br label %2
9: ; preds = %2, %2
ret i32 %4
}
void gtk_ui_manager_remove_ui() {}


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

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

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

LLVM IR (-O2):
define void @gtk_ui_manager_remove_ui() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ LSystem_Exit();
int /*<<< orphan*/ LSystem_Print(char *);
void _LException_Panic() {
  LSystem_Print("Throw without Catch error\n");
  LSystem_Exit();
}


x86 assembly (clang, -O0):
<_LException_Panic>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <LSystem_Print@plt>
mov    $0x0,%al
call   1040 <LSystem_Exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_LException_Panic>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <LSystem_Print@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <LSystem_Exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Throw without Catch error\0A\00"
define void @_LException_Panic() {
%1 = call i32 @LSystem_Print(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @LSystem_Exit()
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"Throw without Catch error\0A\00"
define void @_LException_Panic() {
%1 = tail call i32 @LSystem_Print(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (...) @LSystem_Exit()
ret void
}
__attribute__((always_)) struct eth_device *eth_get_dev(void) {
  extern struct eth_device *eth_current;
  return eth_current;
}


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

x86 assembly (clang, -O2):
<eth_get_dev>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%rax
ret

LLVM IR (-O0):
%struct.eth_device = type opaque
@eth_current = external global %struct.eth_device*
define %struct.eth_device* @eth_get_dev() {
%1 = load %struct.eth_device*, %struct.eth_device** @eth_current
ret %struct.eth_device* %1
}

LLVM IR (-O2):
%struct.eth_device = type opaque
@eth_current = external global %struct.eth_device*
define %struct.eth_device* @eth_get_dev() {
%1 = load %struct.eth_device*, %struct.eth_device** @eth_current
ret %struct.eth_device* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int ENOSYS;
int pthread_sigmask(int how, const sigset_t *set, sigset_t *oldset) {
  ;
  return ENOSYS;
}


x86 assembly (clang, -O0):
<pthread_sigmask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_sigmask>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @pthread_sigmask(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* @ENOSYS
ret i32 %7
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @pthread_sigmask(i32 %0, i32* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
ret i32 %4
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ type;
};
typedef TYPE_1__ XCirculateEvent;

/* Variables and functions */
int get_XCirculateEvent_type(void *_p) {
  return (int)((XCirculateEvent *)_p)->type;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XCirculateEvent_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XCirculateEvent_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fatal_error(int, char *, size_t);
void *malloc(size_t);
void *mymalloc(size_t size) {
  void *p = malloc(size);
  if (!p) {
    fatal_error(2, "Out of memory allocating %d bytes\n", size);
  }
  return p;
}


x86 assembly (clang, -O0):
<mymalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1159 <mymalloc+0x39>
mov    -0x8(%rbp),%rdx
mov    $0x2,%edi
lea    0xeac(%rip),%rsi
call   1030 <fatal_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mymalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1148 <mymalloc+0x28>
lea    0xec5(%rip),%rsi
mov    $0x2,%edi
mov    %r14,%rdx
call   1030 <fatal_error@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [35 x i8] c"Out of memory allocating %d bytes\0A\00"
define i8* @mymalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @fatal_error(i32 2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [35 x i8] c"Out of memory allocating %d bytes\0A\00"
define noalias i8* @mymalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @fatal_error(i32 2, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ prof_ver1to10();
int /*<<< orphan*/ prof_ver31to40();
int main() {
  prof_ver1to10();
  prof_ver31to40();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @prof_ver1to10()
%2 = tail call i32 (...) @prof_ver31to40()
ret i32 0
}
/* Variables and functions */
char *make_string_strtol(long, int);
int /*<<< orphan*/ test_string_strtol(char const *, long, int);
void test_value_with_base_strtol(long value, int base) {
  const char *s;
  s = make_string_strtol(value, base);
  test_string_strtol(s, value, base);
}


x86 assembly (clang, -O0):
<test_value_with_base_strtol>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <make_string_strtol@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1040 <test_string_strtol@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_value_with_base_strtol>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <make_string_strtol@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <test_string_strtol@plt>

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

LLVM IR (-O2):
define void @test_value_with_base_strtol(i64 %0, i32 %1) {
%3 = tail call i8* @make_string_strtol(i64 %0, i32 %1)
%4 = tail call i32 @test_string_strtol(i8* %3, i64 %0, i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ compress_string(char **);
int /*<<< orphan*/ printf(char *, char *);
void main() {
  char *str = "aaaabaaacaaa";
  printf("original string:= %s\n", str);
  compress_string(&str);
  printf("compressed string:= %s\n", str);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xecf(%rip),%rdi
call   1040 <printf@plt>
lea    -0x8(%rbp),%rdi
call   1030 <compress_string@plt>
mov    -0x8(%rbp),%rsi
lea    0xecc(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rsi
mov    %rsi,(%rsp)
lea    0xeda(%rip),%rdi
call   1040 <printf@plt>
mov    %rsp,%rdi
call   1030 <compress_string@plt>
mov    (%rsp),%rsi
lea    0xed8(%rip),%rdi
call   1040 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [13 x i8] c"aaaabaaacaaa\00"
@.str.1 = [22 x i8] c"original string:= %s\0A\00"
@.str.2 = [24 x i8] c"compressed string:= %s\0A\00"
define void @main() {
%1 = alloca i8*
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %1
%2 = load i8*, i8** %1
%3 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%4 = call i32 @compress_string(i8** %1)
%5 = load i8*, i8** %1
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"aaaabaaacaaa\00"
@.str.1 = [22 x i8] c"original string:= %s\0A\00"
@.str.2 = [24 x i8] c"compressed string:= %s\0A\00"
define void @main() {
%1 = alloca i8*
%2 = bitcast i8** %1 to i8*
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @compress_string(i8** %1)
%5 = load i8*, i8** %1
%6 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ isalnum(char);
unsigned short ispunct(char c) { return !isalnum(c); }


x86 assembly (clang, -O0):
<ispunct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
movzwl %ax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ispunct>:
push   %rax
call   1030 <isalnum@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define zeroext i16 @ispunct(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @isalnum(i8 signext %3)
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
%7 = zext i1 %6 to i32
%8 = trunc i32 %7 to i16
ret i16 %8
}

LLVM IR (-O2):
define zeroext i16 @ispunct(i8 signext %0) {
%2 = tail call i32 @isalnum(i8 signext %0)
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i16
ret i16 %4
}
void life() { return; }


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

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

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

LLVM IR (-O2):
define void @life() {
ret void
}
_Bool is_variable(char *s) {
  while (*s != '\0') {
    if (!isalnum((unsigned char)*s) && *s != '_')
      return 0;
    s++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_variable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     116b <is_variable+0x5b>
mov    -0x10(%rbp),%rax
movzbl (%rax),%edi
call   1030 <isalnum@plt>
cmp    $0x0,%eax
jne    115a <is_variable+0x4a>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x5f,%eax
je     115a <is_variable+0x4a>
movb   $0x0,-0x1(%rbp)
jmp    116f <is_variable+0x5f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <is_variable+0xc>
movb   $0x1,-0x1(%rbp)
mov    -0x1(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_variable>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%cl
test   %cl,%cl
je     1147 <is_variable+0x37>
mov    %rdi,%rbx
add    $0x1,%rbx
movzbl %cl,%ebp
mov    %ebp,%edi
call   1030 <isalnum@plt>
test   %eax,%eax
setne  %cl
cmp    $0x5f,%bpl
sete   %al
or     %cl,%al
je     1149 <is_variable+0x39>
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1120 <is_variable+0x10>
jmp    1149 <is_variable+0x39>
mov    $0x1,%al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define zeroext i1 @is_variable(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %7
4: ; preds = %7
%5 = load i8, i8* %15
%6 = icmp eq i8 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %15, %4 ], [ %0, %1 ]
%10 = zext i8 %8 to i32
%11 = tail call i32 @isalnum(i32 %10)
%12 = icmp ne i32 %11, 0
%13 = icmp eq i8 %8, 95
%14 = select i1 %12, i1 true, i1 %13
%15 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %14, label %4, label %16
16: ; preds = %7, %4, %1
%17 = phi i1 [ true, %1 ], [ %14, %4 ], [ %14, %7 ]
ret i1 %17
}
/* Variables and functions */
int get_rounding_mode();
int fegetround(void) { return get_rounding_mode(); }


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

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

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

LLVM IR (-O2):
define i32 @fegetround() {
%1 = tail call i32 (...) @get_rounding_mode()
ret i32 %1
}
/* Variables and functions */
double log(double);
double g1(double x) { return x + 1 - log(x); }


x86 assembly (clang, -O0):
<g1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x10(%rbp),%xmm0
subsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<g1>:
push   %rax
movsd  0xee7(%rip),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
call   1030 <log@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @g1(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fadd double %3, 1.000000e+00
%5 = load double, double* %2
%6 = call double @log(double %5)
%7 = fsub double %4, %6
ret double %7
}

LLVM IR (-O2):
define double @g1(double %0) {
%2 = fadd double %0, 1.000000e+00
%3 = tail call double @log(double %0)
%4 = fsub double %2, %3
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void convert_char(char a) {
  int i = (int)a;
  printf("%i\n", i);
}


x86 assembly (clang, -O0):
<convert_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_char>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
define void @convert_char(i8 signext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
define void @convert_char(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret void
}
/* Type definitions */
typedef int u_int;
typedef int u_char;

/* Variables and functions */
u_int to_u32l(u_char *p) {
  return p[0] + (p[1] << 8) + (p[2] << 16) + (p[3] << 24);
}


x86 assembly (clang, -O0):
<to_u32l>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x8(%rbp),%rcx
mov    0x4(%rcx),%ecx
shl    $0x8,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0xc(%rcx),%ecx
shl    $0x18,%ecx
add    %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<to_u32l>:
mov    0x4(%rdi),%eax
mov    0x8(%rdi),%ecx
shl    $0x8,%eax
add    (%rdi),%eax
shl    $0x10,%ecx
add    %eax,%ecx
mov    0xc(%rdi),%eax
shl    $0x18,%eax
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @to_u32l(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = load i32*, i32** %2
%7 = getelementptr inbounds i32, i32* %6, i64 1
%8 = load i32, i32* %7
%9 = shl i32 %8, 8
%10 = add nsw i32 %5, %9
%11 = load i32*, i32** %2
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32, i32* %12
%14 = shl i32 %13, 16
%15 = add nsw i32 %10, %14
%16 = load i32*, i32** %2
%17 = getelementptr inbounds i32, i32* %16, i64 3
%18 = load i32, i32* %17
%19 = shl i32 %18, 24
%20 = add nsw i32 %15, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @to_u32l(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = shl i32 %4, 8
%6 = add nsw i32 %5, %2
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = shl i32 %8, 16
%10 = add nsw i32 %6, %9
%11 = getelementptr inbounds i32, i32* %0, i64 3
%12 = load i32, i32* %11
%13 = shl i32 %12, 24
%14 = add nsw i32 %10, %13
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() { printf("Hello world!\n"); }


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

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

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

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void I2CSlaveIntEnable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x0000080C))) |= 0x00000001;
}


x86 assembly (clang, -O0):
<I2CSlaveIntEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x80c(%rax),%rcx
or     $0x1,%rcx
mov    %rcx,0x80c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CSlaveIntEnable>:
orq    $0x1,0x80c(%rdi)
01
ret

LLVM IR (-O0):
define void @I2CSlaveIntEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 2060
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 1
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @I2CSlaveIntEnable(i64 %0) {
%2 = add nsw i64 %0, 2060
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 1
store volatile i64 %5, i64* %3
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t g_bit_storage(uint32_t value) {
  uint32_t bits = 0;
  while (value >> bits)
    bits++;
  return bits;
}


x86 assembly (clang, -O0):
<g_bit_storage>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
cmp    $0x0,%eax
je     112d <g_bit_storage+0x2d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <g_bit_storage+0xe>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g_bit_storage>:
mov    $0xffffffff,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ecx
mov    %edi,%eax
sar    %cl,%eax
test   %eax,%eax
jne    1110 <g_bit_storage+0x10>
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @g_bit_storage(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ 0, %1 ], [ %6, %2 ]
%4 = ashr i32 %0, %3
%5 = icmp eq i32 %4, 0
%6 = add nuw nsw i32 %3, 1
br i1 %5, label %7, label %2
7: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ error(char *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int get_sock_fd() {
  int sfd = socket(AF_INET, SOCK_STREAM, 0);
  if (sfd < 0)
    error("Error obtaining socket");
  else
    return sfd;
}


x86 assembly (clang, -O0):
<get_sock_fd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb9(%rip),%rax
mov    (%rax),%edi
mov    0x2ea0(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    115f <get_sock_fd+0x3f>
lea    0xeab(%rip),%rdi
call   1030 <error@plt>
jmp    1165 <get_sock_fd+0x45>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sock_fd>:
push   %rbx
mov    0x2ec0(%rip),%rax
mov    (%rax),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <socket@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    114c <get_sock_fd+0x2c>
lea    0xeb9(%rip),%rdi
call   1030 <error@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [23 x i8] c"Error obtaining socket\00"
define i32 @get_sock_fd() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @AF_INET
%4 = load i32, i32* @SOCK_STREAM
%5 = call i32 @socket(i32 %3, i32 %4, i32 0)
store i32 %5, i32* %2
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %12
10: ; preds = %0
%11 = load i32, i32* %2
store i32 %11, i32* %1
br label %12
12: ; preds = %10, %8
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str = [23 x i8] c"Error obtaining socket\00"
define i32 @get_sock_fd() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = tail call i32 @error(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %0, %5
ret i32 %3
}
int test_imm_B5uint16_reg(unsigned short val) {
  return ((val) & (-0xB5 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_B5uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff4b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_B5uint16_reg>:
test   $0xff4b,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B5uint16_reg(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = zext i16 %3 to i32
%5 = and i32 %4, -181
%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_B5uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -181
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int foo(int a, int b) {
  if (b > 5) {
    a += b;
    return a / b;
  }
  return a + b;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jle    112c <foo+0x2c>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x4(%rbp)
jmp    1135 <foo+0x35>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %edi,%eax
add    %esi,%eax
cmp    $0x6,%esi
jl     110c <foo+0xc>
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @foo(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* %5
%7 = icmp sgt i32 %6, 5
br i1 %7, label %8, label %15
8: ; preds = %2
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = add nsw i32 %10, %9
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = load i32, i32* %5
%14 = sdiv i32 %12, %13
store i32 %14, i32* %3
br label %19
15: ; preds = %2
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = add nsw i32 %16, %17
store i32 %18, i32* %3
br label %19
19: ; preds = %15, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 5
%4 = add nsw i32 %1, %0
br i1 %3, label %5, label %7
5: ; preds = %2
%6 = sdiv i32 %4, %1
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ %6, %5 ], [ %4, %2 ]
ret i32 %8
}