xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ japi_setnamedcolorbg(int, int);
void j_setnamedcolorbg(int arg0, int arg1) { japi_setnamedcolorbg(arg0, arg1); }


x86 assembly (clang, -O0):
<j_setnamedcolorbg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <japi_setnamedcolorbg@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<j_setnamedcolorbg>:
jmp    1030 <japi_setnamedcolorbg@plt>

LLVM IR (-O0):
define void @j_setnamedcolorbg(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = call i32 @japi_setnamedcolorbg(i32 %5, i32 %6)
ret void
}

LLVM IR (-O2):
define void @j_setnamedcolorbg(i32 %0, i32 %1) {
%3 = tail call i32 @japi_setnamedcolorbg(i32 %0, i32 %1)
ret void
}
__attribute__((always_)) unsigned int unaligned32(const void *v) {
  struct Unaligned {
    unsigned int i;
  } __attribute__((packed));
  return ((const struct Unaligned *)v)->i;
}


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

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

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

LLVM IR (-O2):
define i32 @unaligned32(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
int bcd_eq(char *s, char *t) {
  int i;
  for (i = 0; i <= (s[0] - 48); i++) {
    if (s[i] != t[i]) {
      return 0;
    }
  }
  return 1;
}


x86 assembly (clang, -O0):
<bcd_eq>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
sub    $0x30,%ecx
cmp    %ecx,%eax
jg     1167 <bcd_eq+0x67>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     1154 <bcd_eq+0x54>
movl   $0x0,-0x4(%rbp)
jmp    116e <bcd_eq+0x6e>
jmp    1159 <bcd_eq+0x59>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1113 <bcd_eq+0x13>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcd_eq>:
movzbl (%rdi),%r8d
mov    $0x1,%eax
cmp    $0x30,%r8b
jl     1139 <bcd_eq+0x39>
cmp    (%rsi),%r8b
jne    1137 <bcd_eq+0x37>
add    $0xffffffd1,%r8d
mov    $0x1,%edx
nopl   (%rax)
cmp    %rdx,%r8
je     1139 <bcd_eq+0x39>
movzbl (%rdi,%rdx,1),%r9d
lea    0x1(%rdx),%rcx
cmp    (%rsi,%rdx,1),%r9b
mov    %rcx,%rdx
je     1120 <bcd_eq+0x20>
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @bcd_eq(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp slt i8 %3, 48
br i1 %4, label %21, label %5
5: ; preds = %2
%6 = zext i8 %3 to i64
%7 = add nuw nsw i64 %6, 4294967249
%8 = and i64 %7, 4294967295
%9 = load i8, i8* %1
%10 = icmp eq i8 %3, %9
br i1 %10, label %11, label %21
11: ; preds = %5, %15
%12 = phi i64 [ %13, %15 ], [ 0, %5 ]
%13 = add nuw nsw i64 %12, 1
%14 = icmp eq i64 %13, %8
br i1 %14, label %21, label %15
15: ; preds = %11
%16 = getelementptr inbounds i8, i8* %0, i64 %13
%17 = load i8, i8* %16
%18 = getelementptr inbounds i8, i8* %1, i64 %13
%19 = load i8, i8* %18
%20 = icmp eq i8 %17, %19
br i1 %20, label %11, label %21
21: ; preds = %11, %15, %5, %2
%22 = phi i32 [ 1, %2 ], [ 0, %5 ], [ 0, %15 ], [ 1, %11 ]
ret i32 %22
}
/* Type definitions */
struct path {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct path *);
int /*<<< orphan*/ path_destroy(struct path *);
void path_delete(struct path *path) {
  if (path == NULL)
    return;
  path_destroy(path);
  free(path);
}


x86 assembly (clang, -O0):
<path_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    113c <path_delete+0x1c>
jmp    114e <path_delete+0x2e>
mov    -0x8(%rbp),%rdi
call   1040 <path_destroy@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<path_delete>:
test   %rdi,%rdi
je     1137 <path_delete+0x17>
push   %rbx
mov    %rdi,%rbx
call   1040 <path_destroy@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>
ret

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

LLVM IR (-O2):
%struct.path = type { i32 }
define void @path_delete(%struct.path* %0) {
%2 = icmp eq %struct.path* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @path_destroy(%struct.path* %0)
%5 = tail call i32 @free(%struct.path* %0)
br label %6
6: ; preds = %1, %3
ret void
}
/* Variables and functions */
float glmComputeVectorLength2f(float *);
int /*<<< orphan*/ glmMakeVector2f(float *, float const *, float const *);
float glmComputeDistance2f(const float p1[2], const float p2[2]) {
  float d[2];
  glmMakeVector2f(d, p1, p2);
  return glmComputeVectorLength2f(d);
}


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

x86 assembly (clang, -O2):
<glmComputeDistance2f>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <glmMakeVector2f@plt>
mov    %rbx,%rdi
call   1030 <glmComputeVectorLength2f@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @glmComputeDistance2f(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca [2 x float]
store float* %0, float** %3
store float* %1, float** %4
%6 = getelementptr inbounds [2 x float], [2 x float]* %5, i64 0, i64 0
%7 = load float*, float** %3
%8 = load float*, float** %4
%9 = call i32 @glmMakeVector2f(float* %6, float* %7, float* %8)
%10 = getelementptr inbounds [2 x float], [2 x float]* %5, i64 0, i64 0
%11 = call float @glmComputeVectorLength2f(float* %10)
ret float %11
}

LLVM IR (-O2):
define float @glmComputeDistance2f(float* %0, float* %1) {
%3 = alloca [2 x float]
%4 = bitcast [2 x float]* %3 to i8*
%5 = getelementptr inbounds [2 x float], [2 x float]* %3, i64 0, i64 0
%6 = call i32 @glmMakeVector2f(float* %5, float* %0, float* %1)
%7 = call float @glmComputeVectorLength2f(float* %5)
ret float %7
}
/* Type definitions */
typedef int /*<<< orphan*/ td_thrhandle_t;

/* Variables and functions */
int _event_getmsg_helper(td_thrhandle_t const *handle, void *bkpt_addr) {
  void *pc;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @_event_getmsg_helper(i32* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct lffifo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct lffifo *);
void lffifo_free(struct lffifo *fifo) { free(fifo); }


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

x86 assembly (clang, -O2):
<lffifo_free>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
%struct.lffifo = type { i32 }
define void @lffifo_free(%struct.lffifo* nocapture %0) {
%2 = tail call i32 @free(%struct.lffifo* %0)
ret void
}
void mult_2(void *dato) { *((int *)dato) = *((int *)dato) * 2; }


x86 assembly (clang, -O0):
<mult_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mult_2>:
shll   (%rdi)
ret

LLVM IR (-O0):
define void @mult_2(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to i32*
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 2
%7 = load i8*, i8** %2
%8 = bitcast i8* %7 to i32*
store i32 %6, i32* %8
ret void
}

LLVM IR (-O2):
define void @mult_2(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
%4 = shl nsw i32 %3, 1
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putDebugCharReady();
void putDebugChar(char ch) {
  while (!putDebugCharReady())
    ;
  (*(volatile char *)(0x05FFFECB)) = ch;
  (*(volatile char *)(0x05FFFECC)) &= ~0x80;
}


x86 assembly (clang, -O0):
<putDebugChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1030 <putDebugCharReady@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    113a <putDebugChar+0x2a>
jmp    113f <putDebugChar+0x2f>
jmp    111e <putDebugChar+0xe>
mov    -0x1(%rbp),%cl
mov    $0x5fffecb,%eax
mov    %cl,(%rax)
mov    $0x5fffecc,%eax
mov    (%rax),%al
movsbl %al,%eax
and    $0xffffff7f,%eax
mov    %al,%cl
mov    $0x5fffecc,%eax
mov    %cl,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putDebugChar>:
push   %rbx
mov    %edi,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1030 <putDebugCharReady@plt>
test   %eax,%eax
je     1120 <putDebugChar+0x10>
mov    %bl,0x5fffecb
andb   $0x7f,0x5fffecc
7f
pop    %rbx
ret

LLVM IR (-O0):
define void @putDebugChar(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
br label %3
3: ; preds = %7, %1
%4 = call i32 (...) @putDebugCharReady()
%5 = icmp ne i32 %4, 0
%6 = xor i1 %5, true
br i1 %6, label %7, label %8
7: ; preds = %3
br label %3
8: ; preds = %3
%9 = load i8, i8* %2
store volatile i8 %9, i8* inttoptr (i64 100662987 to i8*)
%10 = load volatile i8, i8* inttoptr (i64 100662988 to i8*)
%11 = sext i8 %10 to i32
%12 = and i32 %11, -129
%13 = trunc i32 %12 to i8
store volatile i8 %13, i8* inttoptr (i64 100662988 to i8*)
ret void
}

LLVM IR (-O2):
define void @putDebugChar(i8 signext %0) {
br label %2
2: ; preds = %2, %1
%3 = tail call i32 (...) @putDebugCharReady()
%4 = icmp eq i32 %3, 0
br i1 %4, label %2, label %5
5: ; preds = %2
store volatile i8 %0, i8* inttoptr (i64 100662987 to i8*)
%6 = load volatile i8, i8* inttoptr (i64 100662988 to i8*)
%7 = and i8 %6, 127
store volatile i8 %7, i8* inttoptr (i64 100662988 to i8*)
ret void
}
int withinArray(int *intArray, int size, int *ptr) { return 2; }


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

x86 assembly (clang, -O2):
<withinArray>:
mov    $0x2,%eax
ret

LLVM IR (-O0):
define i32 @withinArray(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
ret i32 2
}

LLVM IR (-O2):
define i32 @withinArray(i32* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
ret i32 2
}
__attribute__((weak)) int foo() { return 3; }


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

x86 assembly (clang, -O2):
<foo>:
mov    $0x3,%eax
ret

LLVM IR (-O0):
define weak i32 @foo() {
ret i32 3
}

LLVM IR (-O2):
define weak i32 @foo() {
ret i32 3
}
/* Type definitions */
struct SocketBuffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buffWrite(unsigned char *, int, struct SocketBuffer *);
void writeByte(unsigned char byte, struct SocketBuffer *buff) {
  buffWrite(&byte, sizeof(unsigned char), buff);
}


x86 assembly (clang, -O0):
<writeByte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
lea    -0x1(%rbp),%rdi
mov    $0x1,%esi
call   1030 <buffWrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writeByte>:
push   %rax
mov    %rsi,%rdx
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1030 <buffWrite@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.SocketBuffer = type { i32 }
define void @writeByte(i8 zeroext %0, %struct.SocketBuffer* %1) {
%3 = alloca i8
%4 = alloca %struct.SocketBuffer*
store i8 %0, i8* %3
store %struct.SocketBuffer* %1, %struct.SocketBuffer** %4
%5 = load %struct.SocketBuffer*, %struct.SocketBuffer** %4
%6 = call i32 @buffWrite(i8* %3, i32 1, %struct.SocketBuffer* %5)
ret void
}

LLVM IR (-O2):
%struct.SocketBuffer = type { i32 }
define void @writeByte(i8 zeroext %0, %struct.SocketBuffer* %1) {
%3 = alloca i8
store i8 %0, i8* %3
%4 = call i32 @buffWrite(i8* %3, i32 1, %struct.SocketBuffer* %1)
ret void
}
/* Variables and functions */
int strlen(char *);
void mychomp(char *s) {
  int k = strlen(s);
  if (k > 0)
    *(s + k - 1) = '\0';
  if ((k > 1) && (*(s + k - 2) == '\r'))
    *(s + k - 2) = '\0';
}


x86 assembly (clang, -O0):
<mychomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    113f <mychomp+0x2f>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,-0x1(%rax,%rcx,1)
cmpl   $0x1,-0xc(%rbp)
jle    116c <mychomp+0x5c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl -0x2(%rax,%rcx,1),%eax
cmp    $0xd,%eax
jne    116c <mychomp+0x5c>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movb   $0x0,-0x2(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mychomp>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    1135 <mychomp+0x25>
mov    %eax,%ecx
movb   $0x0,-0x1(%rbx,%rcx,1)
cmp    $0x1,%eax
je     1135 <mychomp+0x25>
cmpb   $0xd,-0x2(%rbx,%rcx,1)
jne    1135 <mychomp+0x25>
movb   $0x0,-0x2(%rbx,%rcx,1)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @mychomp(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %14
4: ; preds = %1
%5 = zext i32 %2 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = getelementptr inbounds i8, i8* %6, i64 -1
store i8 0, i8* %7
%8 = icmp eq i32 %2, 1
br i1 %8, label %14, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 -2
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 13
br i1 %12, label %13, label %14
13: ; preds = %9
store i8 0, i8* %10
br label %14
14: ; preds = %1, %13, %9, %4
ret void
}
int test_imm_8Buint16_mem(unsigned short *val) {
  return ((*val) & (0x8B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_8Buint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x8b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_8Buint16_mem>:
testb  $0x8b,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_8Buint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 139
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ default_handler();
__attribute__((weak)) void SAI1_IRQHandler() { default_handler(); }


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

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

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

LLVM IR (-O2):
define weak void @SAI1_IRQHandler() {
%1 = tail call i32 (...) @default_handler()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ chiudi_connessione(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stdout;
void fatal_error(int id_connessione) {
  fprintf(stdout,
          "Errore di rete! Verificare il cavo e/o il programma server\n");
  chiudi_connessione(id_connessione);
  exit(EXIT_FAILURE);
}


x86 assembly (clang, -O0):
<fatal_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
lea    0xeb5(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1030 <chiudi_connessione@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<fatal_error>:
push   %rbx
mov    %edi,%ebx
mov    0x2e9e(%rip),%rax
mov    (%rax),%edi
lea    0xebd(%rip),%rsi
call   1040 <fprintf@plt>
mov    %ebx,%edi
call   1030 <chiudi_connessione@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stdout = global i32 0
@.str = [60 x i8] c"Errore di rete! Verificare il cavo e/o il programma server\0A\00"
@EXIT_FAILURE = global i32 0
define void @fatal_error(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stdout
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %2
%6 = call i32 @chiudi_connessione(i32 %5)
%7 = load i32, i32* @EXIT_FAILURE
%8 = call i32 @exit(i32 %7)
unreachable
}

LLVM IR (-O2):
@stdout = global i32 0
@.str = [60 x i8] c"Errore di rete! Verificare il cavo e/o il programma server\0A\00"
@EXIT_FAILURE = global i32 0
define void @fatal_error(i32 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @chiudi_connessione(i32 %0)
%5 = load i32, i32* @EXIT_FAILURE
%6 = tail call i32 @exit(i32 %5)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookpointer4array(void *x, int n) {
  lookNarray((char *)x, (unsigned int)(n * 4));
}


x86 assembly (clang, -O0):
<lookpointer4array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
shl    $0x2,%esi
call   1030 <lookNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookpointer4array>:
shl    $0x2,%esi
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookpointer4array(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = mul nsw i32 %6, 4
%8 = call i32 @lookNarray(i8* %5, i32 %7)
ret void
}

LLVM IR (-O2):
define void @lookpointer4array(i8* %0, i32 %1) {
%3 = shl nsw i32 %1, 2
%4 = tail call i32 @lookNarray(i8* %0, i32 %3)
ret void
}
void __IO_enable_interrupts() {}


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

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

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

LLVM IR (-O2):
define void @__IO_enable_interrupts() {
ret void
}
RX0AX1(r0, r1, x0, x1, p0, p1) unsigned int r0, r1;
unsigned int *p0, *p1;
{
  if ((p0[x0]) <= (((unsigned int *)11111111)[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<RX0AX1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
movslq -0x14(%rbp),%rdx
mov    $0xa98ac7,%ecx
cmp    (%rcx,%rdx,4),%eax
ja     1141 <RX0AX1+0x41>
movl   $0x1,-0x4(%rbp)
jmp    1148 <RX0AX1+0x48>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<RX0AX1>:
movslq %edx,%rax
mov    (%r8,%rax,4),%edx
movslq %ecx,%rcx
xor    %eax,%eax
cmp    0xa98ac7(,%rcx,4),%edx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @RX0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i32* nocapture %4, i32* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %4, i64 %7
%9 = load i32, i32* %8
%10 = sext i32 %3 to i64
%11 = getelementptr inbounds i32, i32* inttoptr (i64 11111111 to i32*), i64 %10
%12 = load i32, i32* %11
%13 = icmp ule i32 %9, %12
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Type definitions */
typedef int /*<<< orphan*/ u_long;
struct hostent {
  int /*<<< orphan*/ h_addr;
};

/* Variables and functions */
int /*<<< orphan*/ exit(int);
struct hostent *gethostbyname(char *);
int /*<<< orphan*/ herror(char *);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
u_long resolve(char *host) {
  struct hostent *he;
  u_long ret;
  if (!(he = gethostbyname(host))) {
    herror("gethostbyname()");
    exit(-1);
  }
  memcpy(&ret, he->h_addr, sizeof(he->h_addr));
  return ret;
}


x86 assembly (clang, -O0):
<resolve>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <gethostbyname@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1179 <resolve+0x39>
lea    0xe96(%rip),%rdi
call   1050 <herror@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    -0x14(%rbp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resolve>:
push   %rax
call   1030 <gethostbyname@plt>
test   %rax,%rax
je     1162 <resolve+0x22>
mov    (%rax),%esi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret
lea    0xe97(%rip),%rdi
call   1050 <herror@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
%struct.hostent = type { i32 }
@.str = [16 x i8] c"gethostbyname()\00"
define i32 @resolve(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.hostent*
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call %struct.hostent* @gethostbyname(i8* %5)
store %struct.hostent* %6, %struct.hostent** %3
%7 = icmp ne %struct.hostent* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = call i32 @herror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %1
%12 = load %struct.hostent*, %struct.hostent** %3
%13 = getelementptr inbounds %struct.hostent, %struct.hostent* %12, i32 0, i32 0
%14 = load i32, i32* %13
%15 = call i32 @memcpy(i32* %4, i32 %14, i32 4)
%16 = load i32, i32* %4
ret i32 %16
}

LLVM IR (-O2):
%struct.hostent = type { i32 }
@.str = [16 x i8] c"gethostbyname()\00"
define i32 @resolve(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = tail call %struct.hostent* @gethostbyname(i8* %0)
%5 = icmp eq %struct.hostent* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = tail call i32 @herror(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 -1)
unreachable
9: ; preds = %1
%10 = getelementptr inbounds %struct.hostent, %struct.hostent* %4, i64 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @memcpy(i32* %2, i32 %11, i32 4)
%13 = load i32, i32* %2
ret i32 %13
}
__attribute__((gnu_)) __attribute__((always_)) int func7b(int x) {
  return x < 23 ? 1 : 4;
}


x86 assembly (clang, -O0):
<func7b>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
mov    $0x4,%eax
mov    $0x1,%ecx
cmp    $0x17,%edx
cmovl  %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func7b>:
xor    %eax,%eax
cmp    $0x17,%edi
setge  %al
lea    (%rax,%rax,2),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @func7b(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 23
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 1, i32 4
ret i32 %6
}

LLVM IR (-O2):
define i32 @func7b(i32 %0) {
%2 = icmp slt i32 %0, 23
%3 = select i1 %2, i32 1, i32 4
ret i32 %3
}
/* Variables and functions */
scalar_t__ is_alpha(unsigned int);
scalar_t__ is_digit(unsigned int);
bool is_alnum(unsigned int ch) { return is_alpha(ch) || is_digit(ch); }


x86 assembly (clang, -O0):
<is_alnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <is_alpha@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <is_alnum+0x37>
mov    -0x4(%rbp),%edi
call   1030 <is_digit@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alnum>:
push   %rbx
mov    %edi,%ebx
call   1040 <is_alpha@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <is_alnum+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <is_digit@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @is_alnum(i32 %0) {
%2 = tail call i64 @is_alpha(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @is_digit(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int kmp(char *, char *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  int res;
  res = kmp("stupid_spring_string", "string");
  printf("Result at %d\n", res);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xedf(%rip),%rsi
call   1040 <kmp@plt>
lea    0xeda(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [21 x i8] c"stupid_spring_string\00"
@.str.1 = [7 x i8] c"string\00"
@.str.2 = [14 x i8] c"Result at %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @kmp(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
float atan2f(float, float);
void __hv_atan2_f(float bIn0, float bIn1, float *bOut) {
  *bOut = atan2f(bIn0, bIn1);
}


x86 assembly (clang, -O0):
<__hv_atan2_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1030 <atan2f@plt>
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__hv_atan2_f>:
push   %rbx
mov    %rdi,%rbx
call   1030 <atan2f@plt>
movss  %xmm0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @__hv_atan2_f(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 = call float @atan2f(float %7, float %8)
%10 = load float*, float** %6
store float %9, float* %10
ret void
}

LLVM IR (-O2):
define void @__hv_atan2_f(float %0, float %1, float* nocapture writeonly %2) {
%4 = tail call float @atan2f(float %0, float %1)
store float %4, float* %2
ret void
}
/* Variables and functions */
bool isEven(int number) {
  if (number % 2 == 0) {
    return true;
  } else {
    return false;
  }
}


x86 assembly (clang, -O0):
<isEven>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1127 <isEven+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <isEven+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isEven>:
mov    %edi,%eax
not    %eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @isEven(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = srem i32 %4, 2
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @isEven(i32 %0) {
%2 = and i32 %0, 1
%3 = xor i32 %2, 1
ret i32 %3
}
void ___fa_plot_trace_once(const char *plot_name, const char *node_name) {
  (void)plot_name;
  (void)node_name;
}


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

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

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

LLVM IR (-O2):
define void @___fa_plot_trace_once(i8* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Delay(int);
int /*<<< orphan*/ lcd_cmd(int, int);
void hx8347_sleep() {
  lcd_cmd(0x28, 0x38);
  Delay(40);
  lcd_cmd(0x1f, 0x89);
  Delay(40);
  lcd_cmd(0x28, 0x04);
  Delay(40);
  lcd_cmd(0x19, 0x00);
  Delay(5);
}


x86 assembly (clang, -O0):
<hx8347_sleep>:
push   %rbp
mov    %rsp,%rbp
mov    $0x28,%edi
mov    $0x38,%esi
call   1040 <lcd_cmd@plt>
mov    $0x28,%edi
call   1030 <Delay@plt>
mov    $0x1f,%edi
mov    $0x89,%esi
call   1040 <lcd_cmd@plt>
mov    $0x28,%edi
call   1030 <Delay@plt>
mov    $0x28,%edi
mov    $0x4,%esi
call   1040 <lcd_cmd@plt>
mov    $0x28,%edi
call   1030 <Delay@plt>
mov    $0x19,%edi
xor    %esi,%esi
call   1040 <lcd_cmd@plt>
mov    $0x5,%edi
call   1030 <Delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<hx8347_sleep>:
push   %rax
mov    $0x28,%edi
mov    $0x38,%esi
call   1040 <lcd_cmd@plt>
mov    $0x28,%edi
call   1030 <Delay@plt>
mov    $0x1f,%edi
mov    $0x89,%esi
call   1040 <lcd_cmd@plt>
mov    $0x28,%edi
call   1030 <Delay@plt>
mov    $0x28,%edi
mov    $0x4,%esi
call   1040 <lcd_cmd@plt>
mov    $0x28,%edi
call   1030 <Delay@plt>
mov    $0x19,%edi
xor    %esi,%esi
call   1040 <lcd_cmd@plt>
mov    $0x5,%edi
pop    %rax
jmp    1030 <Delay@plt>

LLVM IR (-O0):
define void @hx8347_sleep() {
%1 = call i32 @lcd_cmd(i32 40, i32 56)
%2 = call i32 @Delay(i32 40)
%3 = call i32 @lcd_cmd(i32 31, i32 137)
%4 = call i32 @Delay(i32 40)
%5 = call i32 @lcd_cmd(i32 40, i32 4)
%6 = call i32 @Delay(i32 40)
%7 = call i32 @lcd_cmd(i32 25, i32 0)
%8 = call i32 @Delay(i32 5)
ret void
}

LLVM IR (-O2):
define void @hx8347_sleep() {
%1 = tail call i32 @lcd_cmd(i32 40, i32 56)
%2 = tail call i32 @Delay(i32 40)
%3 = tail call i32 @lcd_cmd(i32 31, i32 137)
%4 = tail call i32 @Delay(i32 40)
%5 = tail call i32 @lcd_cmd(i32 40, i32 4)
%6 = tail call i32 @Delay(i32 40)
%7 = tail call i32 @lcd_cmd(i32 25, i32 0)
%8 = tail call i32 @Delay(i32 5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testDoomsday();
void runTests() { testDoomsday(); }


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

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

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

LLVM IR (-O2):
define void @runTests() {
%1 = tail call i32 (...) @testDoomsday()
ret void
}
unsigned long long f(unsigned long long a) { return a & 0xffffffULL; }


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

x86 assembly (clang, -O2):
<f>:
mov    %rdi,%rax
and    $0xffffff,%eax
ret

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

LLVM IR (-O2):
define i64 @f(i64 %0) {
%2 = and i64 %0, 16777215
ret i64 %2
}
char *id_wsuf() {
  return ("64");
  return ("");
}


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

x86 assembly (clang, -O2):
<id_wsuf>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [3 x i8] c"64\00"
define i8* @id_wsuf() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [3 x i8] c"64\00"
define i8* @id_wsuf() {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
char *strdup(char *);
char *convert_time(time_t t) {
  char *c_time_string = ctime(&t);
  if (c_time_string == NULL) {
    (void)fprintf(stderr, "Failure to convert the current time.");
    exit(EXIT_FAILURE);
  }
  return strdup(c_time_string);
}


x86 assembly (clang, -O0):
<convert_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <ctime@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1186 <convert_time+0x46>
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
lea    0xe8d(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rdi
call   1060 <strdup@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_time>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <ctime@plt>
test   %rax,%rax
je     115e <convert_time+0x1e>
mov    %rax,%rdi
call   1060 <strdup@plt>
pop    %rcx
ret
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xe92(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [37 x i8] c"Failure to convert the current time.\00"
@EXIT_FAILURE = global i32 0
define i8* @convert_time(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* @ctime(i32* %2)
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* @stderr
%9 = call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
%14 = call i8* @strdup(i8* %13)
ret i8* %14
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [37 x i8] c"Failure to convert the current time.\00"
@EXIT_FAILURE = global i32 0
define noalias i8* @convert_time(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i8* @ctime(i32* %2)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = call i32 @exit(i32 %8)
unreachable
10: ; preds = %1
%11 = call i8* @strdup(i8* %3)
ret i8* %11
}
/* Type definitions */
struct pooled_fd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ fdpool_insert_head(struct pooled_fd *);
int /*<<< orphan*/ fdpool_remove(struct pooled_fd *);
void fdpool_touch(struct pooled_fd *pfd) {
  fdpool_remove(pfd);
  fdpool_insert_head(pfd);
}


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

x86 assembly (clang, -O2):
<fdpool_touch>:
push   %rbx
mov    %rdi,%rbx
call   1040 <fdpool_remove@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <fdpool_insert_head@plt>

LLVM IR (-O0):
%struct.pooled_fd = type { i32 }
define void @fdpool_touch(%struct.pooled_fd* %0) {
%2 = alloca %struct.pooled_fd*
store %struct.pooled_fd* %0, %struct.pooled_fd** %2
%3 = load %struct.pooled_fd*, %struct.pooled_fd** %2
%4 = call i32 @fdpool_remove(%struct.pooled_fd* %3)
%5 = load %struct.pooled_fd*, %struct.pooled_fd** %2
%6 = call i32 @fdpool_insert_head(%struct.pooled_fd* %5)
ret void
}

LLVM IR (-O2):
%struct.pooled_fd = type { i32 }
define void @fdpool_touch(%struct.pooled_fd* %0) {
%2 = tail call i32 @fdpool_remove(%struct.pooled_fd* %0)
%3 = tail call i32 @fdpool_insert_head(%struct.pooled_fd* %0)
ret void
}
/* Variables and functions */
scalar_t__ TPM_GetRandom(unsigned char *);
int TSS_gennonce(unsigned char *buf) { return ((int)TPM_GetRandom(buf)); }


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

x86 assembly (clang, -O2):
<TSS_gennonce>:
jmp    1030 <TPM_GetRandom@plt>

LLVM IR (-O0):
define i32 @TSS_gennonce(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @TPM_GetRandom(i8* %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @TSS_gennonce(i8* %0) {
%2 = tail call i64 @TPM_GetRandom(i8* %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
char *strchr(char *, char);
int at_tok_nextColon(char **p_cur) {
  if (*p_cur == NULL) {
    return -1;
  }
  *p_cur = strchr(*p_cur, ':');
  if (*p_cur == NULL) {
    return -1;
  }
  (*p_cur)++;
  return 0;
}


x86 assembly (clang, -O0):
<at_tok_nextColon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    1136 <at_tok_nextColon+0x26>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <at_tok_nextColon+0x70>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
cmpq   $0x0,(%rax)
jne    116b <at_tok_nextColon+0x5b>
movl   $0xffffffff,-0x4(%rbp)
jmp    1180 <at_tok_nextColon+0x70>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<at_tok_nextColon>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
mov    $0xffffffff,%ebp
test   %rdi,%rdi
je     113e <at_tok_nextColon+0x2e>
mov    $0x3a,%esi
call   1030 <strchr@plt>
mov    %rax,(%rbx)
test   %rax,%rax
je     113e <at_tok_nextColon+0x2e>
add    $0x1,%rax
mov    %rax,(%rbx)
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @at_tok_nextColon(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
store i8** %0, i8*** %3
%4 = load i8**, i8*** %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 -1, i32* %2
br label %21
8: ; preds = %1
%9 = load i8**, i8*** %3
%10 = load i8*, i8** %9
%11 = call i8* @strchr(i8* %10, i8 signext 58)
%12 = load i8**, i8*** %3
store i8* %11, i8** %12
%13 = load i8**, i8*** %3
%14 = load i8*, i8** %13
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %17
16: ; preds = %8
store i32 -1, i32* %2
br label %21
17: ; preds = %8
%18 = load i8**, i8*** %3
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %18
store i32 0, i32* %2
br label %21
21: ; preds = %17, %16, %7
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @at_tok_nextColon(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %9, label %4
4: ; preds = %1
%5 = tail call i8* @strchr(i8* %2, i8 signext 58)
store i8* %5, i8** %0
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8* %8, i8** %0
br label %9
9: ; preds = %4, %1, %7
%10 = phi i32 [ 0, %7 ], [ -1, %1 ], [ -1, %4 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello from prog1.c\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [20 x i8] c"Hello from prog1.c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

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


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

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

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

LLVM IR (-O2):
define void @baz() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int num;
  for (num = 0; num < 10000; num += 2) {
    printf("%d - ", num);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x2710,-0x8(%rbp)
jge    1150 <main+0x40>
mov    -0x8(%rbp),%esi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    $0xfffffffe,%ebx
lea    0xee0(%rip),%r14
add    $0x2,%ebx
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    $0x270e,%ebx
jb     1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d - \00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = add nuw nsw i32 %2, 2
%5 = icmp ult i32 %2, 9998
br i1 %5, label %1, label %6
6: ; preds = %1
ret i32 0
}