xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
void ff_image_decode(FILE *inf) {}


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

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

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

LLVM IR (-O2):
define void @ff_image_decode(i32* nocapture %0) {
ret void
}
void ff_hevc_put_hevc_bi_pel_pixels4_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_pel_pixels4_12_sse4() {
ret void
}
void _Semaphore_Destroy(struct _Semaphore_Control *_semaphore) {
  (void)_semaphore;
}


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

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

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

LLVM IR (-O2):
%struct._Semaphore_Control = type opaque
define void @_Semaphore_Destroy(%struct._Semaphore_Control* nocapture %0) {
ret void
}
void coresight_cti_unmap_trigin(struct coresight_cti *cti, int trig, int ch) {}


x86 assembly (clang, -O0):
<coresight_cti_unmap_trigin>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.coresight_cti = type opaque
define void @coresight_cti_unmap_trigin(%struct.coresight_cti* %0, i32 %1, i32 %2) {
%4 = alloca %struct.coresight_cti*
%5 = alloca i32
%6 = alloca i32
store %struct.coresight_cti* %0, %struct.coresight_cti** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
%struct.coresight_cti = type opaque
define void @coresight_cti_unmap_trigin(%struct.coresight_cti* nocapture %0, i32 %1, i32 %2) {
ret void
}
/* Variables and functions */
float C_K(float);
float F_C(float);
float F_K(float n) {
  n = F_C(n);
  n = C_K(n);
  return n;
}


x86 assembly (clang, -O0):
<F_K>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <F_C@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1040 <C_K@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<F_K>:
push   %rax
call   1030 <F_C@plt>
pop    %rax
jmp    1040 <C_K@plt>

LLVM IR (-O0):
define float @F_K(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call float @F_C(float %3)
store float %4, float* %2
%5 = load float, float* %2
%6 = call float @C_K(float %5)
store float %6, float* %2
%7 = load float, float* %2
ret float %7
}

LLVM IR (-O2):
define float @F_K(float %0) {
%2 = tail call float @F_C(float %0)
%3 = tail call float @C_K(float %2)
ret float %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;
struct xc_die {
  int dummy;
};

/* Variables and functions */
scalar_t__ xc6_get_iob_data_len(struct xc_die const *);
scalar_t__ xc6_get_iob_start(struct xc_die const *);
uint32_t xc6_get_bit_end(const struct xc_die *die) {
  return xc6_get_iob_start(die) + xc6_get_iob_data_len(die);
}


x86 assembly (clang, -O0):
<xc6_get_bit_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <xc6_get_iob_start@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <xc6_get_iob_data_len@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xc6_get_bit_end>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1040 <xc6_get_iob_start@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <xc6_get_iob_data_len@plt>
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.xc_die = type { i32 }
define i64 @xc6_get_bit_end(%struct.xc_die* %0) {
%2 = alloca %struct.xc_die*
store %struct.xc_die* %0, %struct.xc_die** %2
%3 = load %struct.xc_die*, %struct.xc_die** %2
%4 = call i64 @xc6_get_iob_start(%struct.xc_die* %3)
%5 = load %struct.xc_die*, %struct.xc_die** %2
%6 = call i64 @xc6_get_iob_data_len(%struct.xc_die* %5)
%7 = add nsw i64 %4, %6
ret i64 %7
}

LLVM IR (-O2):
%struct.xc_die = type { i32 }
define i64 @xc6_get_bit_end(%struct.xc_die* %0) {
%2 = tail call i64 @xc6_get_iob_start(%struct.xc_die* %0)
%3 = tail call i64 @xc6_get_iob_data_len(%struct.xc_die* %0)
%4 = add nsw i64 %3, %2
ret i64 %4
}
/* Variables and functions */
char *strstr(char const *, char *);
int strpos(const char *haystack, char *needle) {
  char *p = strstr(haystack, needle);
  if (p) {
    return p - haystack;
  }
  return -1;
}


x86 assembly (clang, -O0):
<strpos>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     114f <strpos+0x3f>
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
mov    %eax,-0x4(%rbp)
jmp    1156 <strpos+0x46>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpos>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strstr@plt>
mov    %eax,%ecx
sub    %ebx,%ecx
cmp    $0x1,%rax
sbb    %eax,%eax
or     %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @strpos(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
%5 = ptrtoint i8* %3 to i64
%6 = ptrtoint i8* %0 to i64
%7 = sub i64 %5, %6
%8 = trunc i64 %7 to i32
%9 = select i1 %4, i32 -1, i32 %8
ret i32 %9
}
int main() {
  int x = 20;
  int *ptr_x;
  ptr_x = &x;
  printf("x: %x\n", &x);
  printf("ptr_x: %x\n", ptr_x);
  printf("*ptr_x: %d\n", *ptr_x);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x14,0xc(%rsp)
lea    0xee0(%rip),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec6(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0xc(%rsp),%esi
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"x: %x\0A\00"
@.str.1 = [11 x i8] c"ptr_x: %x\0A\00"
@.str.2 = [12 x i8] c"*ptr_x: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 20, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %5)
ret i32 0
}
int BTSHASP_CheckIncludeHashName(char *str) {
  int h;
  char *s;
  s = str;
  h = 0;
  while (*s)
    h = (h * 251) + (*s++);
  h = h * 251;
  return ((h >> 8) & 4095);
}


x86 assembly (clang, -O0):
<BTSHASP_CheckIncludeHashName>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1147 <BTSHASP_CheckIncludeHashName+0x47>
imul   $0xfb,-0xc(%rbp),%eax
mov    -0x18(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <BTSHASP_CheckIncludeHashName+0x17>
imul   $0xfb,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xfff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<BTSHASP_CheckIncludeHashName>:
mov    (%rdi),%cl
test   %cl,%cl
je     112f <BTSHASP_CheckIncludeHashName+0x2f>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %eax,%ecx
imul   $0xfb,%ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <BTSHASP_CheckIncludeHashName+0x10>
shr    $0x8,%eax
and    $0xfff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @BTSHASP_CheckIncludeHashName(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 0, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = sext i8 %5 to i32
%10 = add nsw i32 %7, %9
%11 = mul i32 %10, 251
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = lshr i32 %11, 8
%16 = and i32 %15, 4095
br label %17
17: ; preds = %14, %1
%18 = phi i32 [ 0, %1 ], [ %16, %14 ]
ret i32 %18
}
void save_forward_arrays_undoatt_adios_(void) {}


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

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

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

LLVM IR (-O2):
define void @save_forward_arrays_undoatt_adios_() {
ret void
}
/* Variables and functions */
scalar_t__ __isnanl(long double);
scalar_t__ islessequal(long double, long double);
long double fminl(long double _x, long double _y) {
  return ((islessequal(_x, _y) || __isnanl(_y)) ? _x : _y);
}


x86 assembly (clang, -O0):
<fminl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fstpt  -0x20(%rbp)
fldt   -0x10(%rbp)
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  0x10(%rax)
fstpt  (%rax)
call   1040 <islessequal@plt>
cmp    $0x0,%rax
jne    1168 <fminl+0x48>
fldt   -0x20(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <__isnanl@plt>
cmp    $0x0,%rax
je     1173 <fminl+0x53>
fldt   -0x10(%rbp)
fstpt  -0x2c(%rbp)
jmp    1179 <fminl+0x59>
fldt   -0x20(%rbp)
fstpt  -0x2c(%rbp)
fldt   -0x2c(%rbp)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fminl>:
sub    $0x38,%rsp
fldt   0x50(%rsp)
fldt   0x40(%rsp)
fld    %st(1)
fstpt  0x20(%rsp)
fxch   %st(1)
fstpt  0x10(%rsp)
fld    %st(0)
fstpt  0x2c(%rsp)
fstpt  (%rsp)
call   1040 <islessequal@plt>
test   %rax,%rax
je     1154 <fminl+0x34>
fldt   0x2c(%rsp)
add    $0x38,%rsp
ret
fldt   0x20(%rsp)
fstpt  (%rsp)
call   1030 <__isnanl@plt>
test   %rax,%rax
fldt   0x2c(%rsp)
fldt   0x20(%rsp)
fxch   %st(1)
fcmove %st(1),%st
fstp   %st(1)
add    $0x38,%rsp
ret

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

LLVM IR (-O2):
define x86_fp80 @fminl(x86_fp80 %0, x86_fp80 %1) {
%3 = tail call i64 @islessequal(x86_fp80 %0, x86_fp80 %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i64 @__isnanl(x86_fp80 %1)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, x86_fp80 %1, x86_fp80 %0
br label %9
9: ; preds = %5, %2
%10 = phi x86_fp80 [ %0, %2 ], [ %8, %5 ]
ret x86_fp80 %10
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t next(uint8_t place) {
  if (place == 0) {
    place = 32;
  }
  return place - 1;
}


x86 assembly (clang, -O0):
<next>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1118 <next+0x18>
movl   $0x20,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next>:
sub    $0x1,%edi
mov    $0x1f,%eax
cmovae %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @next(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = add nsw i32 %0, -1
%4 = select i1 %2, i32 31, i32 %3
ret i32 %4
}
/* Variables and functions */
int strspn(char const *, char const *);
char const *strcpbrk(char const *str, char const *reject) {
  return str + strspn(str, reject);
}


x86 assembly (clang, -O0):
<strcpbrk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strspn@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpbrk>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strspn@plt>
cltq
add    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @strcpbrk(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** %3
%7 = load i8*, i8** %4
%8 = call i32 @strspn(i8* %6, i8* %7)
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %5, i64 %9
ret i8* %10
}

LLVM IR (-O2):
define i8* @strcpbrk(i8* %0, i8* nocapture %1) {
%3 = tail call i32 @strspn(i8* %0, i8* %1)
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
ret i8* %5
}
int LEFT(int i) { return 2 * (i + 1) - 1; }


x86 assembly (clang, -O0):
<LEFT>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
shl    $0x1,%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<LEFT>:
lea    (%rdi,%rdi,1),%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @LEFT(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = mul nsw i32 2, %4
%6 = sub nsw i32 %5, 1
ret i32 %6
}

LLVM IR (-O2):
define i32 @LEFT(i32 %0) {
%2 = shl i32 %0, 1
%3 = or i32 %2, 1
ret i32 %3
}
/* Variables and functions */
char *strstr(char *, char *);
char *find_mime(char *p) {
  if ((p = strstr(p, "Content-Disposition: form-data;")) != NULL)
    p += 31;
  return (p);
}


x86 assembly (clang, -O0):
<find_mime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
je     1146 <find_mime+0x36>
mov    -0x8(%rbp),%rax
add    $0x1f,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_mime>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strstr@plt>
lea    0x1f(%rax),%rcx
test   %rax,%rax
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Content-Disposition: form-data;\00"
define i8* @find_mime(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @strstr(i8* %3, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 31
store i8* %8, i8** %2
br label %9
9: ; preds = %6, %1
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [32 x i8] c"Content-Disposition: form-data;\00"
define i8* @find_mime(i8* %0) {
%2 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 31
%5 = select i1 %3, i8* null, i8* %4
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void adddep(char *file) { printf("\t%s", file); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"\09%s\00"
define void @adddep(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int test_imm_64uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x64 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_64uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 6553600
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int *list2(x, y)
int *y;
{
  int *p = newvec(1);
  p[0] = x;
  p[1] = (int)y;
  return p;
}


x86 assembly (clang, -O0):
<list2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1,%edi
mov    $0x0,%al
call   1030 <newvec@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list2>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
mov    $0x1,%edi
xor    %eax,%eax
call   1030 <newvec@plt>
cltq
mov    %ebp,(%rax)
mov    %ebx,0x4(%rax)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32* @list2(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%6 = call i32 (i32, ...) bitcast (i32 (...)* @newvec to i32 (i32, ...)*)(i32 1)
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
store i32* %8, i32** %5
%9 = load i32, i32* %3
%10 = load i32*, i32** %5
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
%12 = load i32*, i32** %4
%13 = ptrtoint i32* %12 to i32
%14 = load i32*, i32** %5
%15 = getelementptr inbounds i32, i32* %14, i64 1
store i32 %13, i32* %15
%16 = load i32*, i32** %5
ret i32* %16
}

LLVM IR (-O2):
define i32* @list2(i32 %0, i32* %1) {
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @newvec to i32 (i32, ...)*)(i32 1)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
store i32 %0, i32* %5
%6 = ptrtoint i32* %1 to i64
%7 = trunc i64 %6 to i32
%8 = getelementptr inbounds i32, i32* %5, i64 1
store i32 %7, i32* %8
ret i32* %5
}
/* Type definitions */
struct jit_state {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ emit_alu64(struct jit_state *, int, int, int);
void emit_mov(struct jit_state *state, int src, int dst) {
  emit_alu64(state, 0x89, src, dst);
}


x86 assembly (clang, -O0):
<emit_mov>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    $0x89,%esi
call   1030 <emit_alu64@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_mov>:
mov    %edx,%ecx
mov    %esi,%edx
mov    $0x89,%esi
jmp    1030 <emit_alu64@plt>

LLVM IR (-O0):
%struct.jit_state = type { i32 }
define void @emit_mov(%struct.jit_state* %0, i32 %1, i32 %2) {
%4 = alloca %struct.jit_state*
%5 = alloca i32
%6 = alloca i32
store %struct.jit_state* %0, %struct.jit_state** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.jit_state*, %struct.jit_state** %4
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = call i32 @emit_alu64(%struct.jit_state* %7, i32 137, i32 %8, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.jit_state = type { i32 }
define void @emit_mov(%struct.jit_state* %0, i32 %1, i32 %2) {
%4 = tail call i32 @emit_alu64(%struct.jit_state* %0, i32 137, i32 %1, i32 %2)
ret void
}
srand1(s) char *s;
{
  int i;
  while (*s)
    putchar(*s++);
  while (!kbhit())
    i++;
  srand(i);
}


x86 assembly (clang, -O0):
<srand1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     1167 <srand1+0x37>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movsbl (%rax),%edi
mov    $0x0,%al
call   1030 <putchar@plt>
jmp    113c <srand1+0xc>
jmp    116c <srand1+0x3c>
mov    $0x0,%al
call   1040 <kbhit@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1188 <srand1+0x58>
jmp    1196 <srand1+0x66>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    116c <srand1+0x3c>
mov    -0x14(%rbp),%edi
mov    $0x0,%al
call   1050 <srand@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<srand1>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1155 <srand1+0x25>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <srand1+0x10>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %eax,%eax
call   1040 <kbhit@plt>
add    $0x1,%ebx
test   %eax,%eax
je     1160 <srand1+0x30>
mov    %ebx,%edi
xor    %eax,%eax
pop    %rbx
jmp    1050 <srand@plt>

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

LLVM IR (-O2):
define i32 @srand1(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %12, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %10, %4 ], [ %2, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = sext i8 %5 to i32
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %8)
%10 = load i8, i8* %7
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %4
12: ; preds = %4, %1
br label %13
13: ; preds = %12, %13
%14 = phi i32 [ %17, %13 ], [ undef, %12 ]
%15 = tail call i32 (...) @kbhit()
%16 = icmp eq i32 %15, 0
%17 = add nsw i32 %14, 1
br i1 %16, label %13, label %18
18: ; preds = %13
%19 = tail call i32 (i32, ...) bitcast (i32 (...)* @srand to i32 (i32, ...)*)(i32 %14)
ret i32 undef
}
double celsius(int fahr) { return (5.0 / 9.0) * (fahr - 32); }


x86 assembly (clang, -O0):
<celsius>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x20,%eax
cvtsi2sd %eax,%xmm1
movsd  0xee7(%rip),%xmm0
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<celsius>:
add    $0xffffffe0,%edi
cvtsi2sd %edi,%xmm0
mulsd  0xef1(%rip),%xmm0
ret

LLVM IR (-O0):
define double @celsius(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 32
%5 = sitofp i32 %4 to double
%6 = fmul double 0x3FE1C71C71C71C72, %5
ret double %6
}

LLVM IR (-O2):
define double @celsius(i32 %0) {
%2 = add nsw i32 %0, -32
%3 = sitofp i32 %2 to double
%4 = fmul double %3, 0x3FE1C71C71C71C72
ret double %4
}
int test_imm_68int64_lowword_mem(long long *val) {
  return ((*val) & (0x68 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_68int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 104
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *const,
                           size_t const);
int /*<<< orphan*/ stderr;
void lpg_to_do(char const *const file, size_t const line) {
  fprintf(stderr,
          "Encountered LPG_TO_DO() at %s:%zu. You tried to use a "
          "feature that has not been implemented yet.\n",
          file, line);
  abort();
}


x86 assembly (clang, -O0):
<lpg_to_do>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<lpg_to_do>:
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [98 x i8] c"Encountered LPG_TO_DO() at %s:%zu. You tried to use a feature that has not been implemented yet.\0A\00"
define void @lpg_to_do(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %3
%7 = load i64, i64* %4
%8 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), i8* %6, i64 %7)
%9 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [98 x i8] c"Encountered LPG_TO_DO() at %s:%zu. You tried to use a feature that has not been implemented yet.\0A\00"
define void @lpg_to_do(i8* %0, i64 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0), i8* %0, i64 %1)
%5 = tail call i32 (...) @abort()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("\nHello Git :)\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%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 = [16 x i8] c"\0AHello Git :)\0A\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [15 x i8] c"\0AHello Git :)\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ addOne(int *);
int /*<<< orphan*/ assert(int);
int main(int argc, char *argv[]) {
  int a = 1;
  addOne(&a);
#pragma omp taskwait
  assert(a == 2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
lea    -0x14(%rbp),%rdi
call   1040 <addOne@plt>
cmpl   $0x2,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x1,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1040 <addOne@plt>
xor    %edi,%edi
cmpl   $0x2,0x4(%rsp)
sete   %dil
call   1030 <assert@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
store i32 1, i32* %5
%6 = call i32 @addOne(i32* %5)
%7 = load i32, i32* %5
%8 = icmp eq i32 %7, 2
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%5 = call i32 @addOne(i32* %3)
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 2
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret i32 0
}
void next5() {
  asm("#"
      "5");
}


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

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

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

LLVM IR (-O2):
define void @next5() {
tail call void asm sideeffect "", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fs_univ_emptysustained(int /*<<< orphan*/,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/);
int /*<<< orphan*/ main_time();
void fs_emptysustained(void) {
  (void)fs_univ_emptysustained(main_time(), 0, 0);
}


x86 assembly (clang, -O0):
<fs_emptysustained>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <main_time@plt>
mov    %eax,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1030 <fs_univ_emptysustained@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fs_emptysustained>:
push   %rax
xor    %eax,%eax
call   1040 <main_time@plt>
mov    %eax,%edi
xor    %esi,%esi
xor    %edx,%edx
pop    %rax
jmp    1030 <fs_univ_emptysustained@plt>

LLVM IR (-O0):
define void @fs_emptysustained() {
%1 = call i32 (...) @main_time()
%2 = call i32 @fs_univ_emptysustained(i32 %1, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @fs_emptysustained() {
%1 = tail call i32 (...) @main_time()
%2 = tail call i32 @fs_univ_emptysustained(i32 %1, i32 0, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ wchar_t;

/* Variables and functions */
int /*<<< orphan*/ __infer_nondet_int();
size_t wcstombs(char *__restrict s, const wchar_t *__restrict pwcs, size_t n) {
  return (size_t)__infer_nondet_int();
}


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

x86 assembly (clang, -O2):
<wcstombs>:
push   %rax
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @wcstombs(i8* noalias %0, i32* noalias %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i64
store i8* %0, i8** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%7 = call i32 (...) @__infer_nondet_int()
%8 = sext i32 %7 to i64
ret i64 %8
}

LLVM IR (-O2):
define i64 @wcstombs(i8* noalias nocapture readnone %0, i32* noalias nocapture readnone %1, i64 %2) {
%4 = tail call i32 (...) @__infer_nondet_int()
%5 = sext i32 %4 to i64
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ print(char *);
int /*<<< orphan*/ printid(int);
int main() {
  int a = 1, b = 2;
  if (a != b)
    print("a 1");
  printid(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1155 <main+0x35>
lea    0xeb0(%rip),%rdi
call   1030 <print@plt>
mov    -0x8(%rbp),%edi
call   1040 <printid@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <print@plt>
mov    $0x1,%edi
call   1040 <printid@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"a 1\00"
define i32 @main() {
%1 = tail call i32 @print(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printid(i32 1)
ret i32 0
}
void foo_2_1_1_2_2_2_1_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_1_1_2_2_2_1_2_2() {
ret void
}
/* Type definitions */
struct pt_encoder {
  int dummy;
};

/* Variables and functions */
void pt_encoder_fini(struct pt_encoder *encoder) { (void)encoder; }


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

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

LLVM IR (-O0):
%struct.pt_encoder = type { i32 }
define void @pt_encoder_fini(%struct.pt_encoder* %0) {
%2 = alloca %struct.pt_encoder*
store %struct.pt_encoder* %0, %struct.pt_encoder** %2
%3 = load %struct.pt_encoder*, %struct.pt_encoder** %2
ret void
}

LLVM IR (-O2):
%struct.pt_encoder = type { i32 }
define void @pt_encoder_fini(%struct.pt_encoder* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage() { printf("./fms_hotplug [device]\n"); }


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

x86 assembly (clang, -O2):
<usage>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [23 x i8] c"./fms_hotplug [device]\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void baz(void) {
  int32_t result24;
  const int32_t other = 7;
}


x86 assembly (clang, -O0):
<baz>:
push   %rbp
mov    %rsp,%rbp
movl   $0x7,-0x8(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @baz() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
struct tm *Time_time() {
  time_t t = time(NULL);
  return localtime(&t);
}


x86 assembly (clang, -O0):
<Time_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Time_time>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define %struct.tm* @Time_time() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
store i32 %2, i32* %1
%3 = call %struct.tm* @localtime(i32* %1)
ret %struct.tm* %3
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define %struct.tm* @Time_time() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
ret %struct.tm* %4
}
/* Variables and functions */
size_t my_strnlen(const char *s, size_t n) {
  size_t len = 0;
  while (n-- && *s++)
    len++;
  return len;
}


x86 assembly (clang, -O0):
<my_strnlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    %rcx,%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x19(%rbp)
je     114d <my_strnlen+0x4d>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    115d <my_strnlen+0x5d>
jmp    116e <my_strnlen+0x6e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1114 <my_strnlen+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strnlen>:
xor    %eax,%eax
test   %rsi,%rsi
je     1122 <my_strnlen+0x22>
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,(%rdi,%rax,1)
je     1122 <my_strnlen+0x22>
add    $0x1,%rax
cmp    %rax,%rsi
jne    1110 <my_strnlen+0x10>
mov    %rsi,%rax
ret

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

LLVM IR (-O2):
define i64 @my_strnlen(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %15, label %4
4: ; preds = %2, %11
%5 = phi i64 [ %8, %11 ], [ %1, %2 ]
%6 = phi i64 [ %13, %11 ], [ 0, %2 ]
%7 = phi i8* [ %12, %11 ], [ %0, %2 ]
%8 = add i64 %5, -1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %15, label %11
11: ; preds = %4
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = add nuw i64 %6, 1
%14 = icmp eq i64 %8, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %11, %2
%16 = phi i64 [ 0, %2 ], [ %1, %11 ], [ %6, %4 ]
ret i64 %16
}
int main(void) {
  int i = 3, ii = 4, iii = 5;
  struct _struct {
    int i;
    double d;
    struct _struct *s;
  } myS = {.d = 3.0 + i, 0};
  struct _struct myS2 = {i + ii + iii, .s = &myS};
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
movl   $0x0,-0x28(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xecc(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x38(%rbp)
lea    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct._struct = type { i32, double, %struct._struct* }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca %struct._struct
%6 = alloca %struct._struct
store i32 0, i32* %1
store i32 3, i32* %2
store i32 4, i32* %3
store i32 5, i32* %4
%7 = getelementptr inbounds %struct._struct, %struct._struct* %5, i32 0, i32 0
store i32 0, i32* %7
%8 = getelementptr inbounds %struct._struct, %struct._struct* %5, i32 0, i32 1
%9 = load i32, i32* %2
%10 = sitofp i32 %9 to double
%11 = fadd double 3.000000e+00, %10
store double %11, double* %8
%12 = getelementptr inbounds %struct._struct, %struct._struct* %5, i32 0, i32 2
store %struct._struct* null, %struct._struct** %12
%13 = getelementptr inbounds %struct._struct, %struct._struct* %6, i32 0, i32 0
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = add nsw i32 %14, %15
%17 = load i32, i32* %4
%18 = add nsw i32 %16, %17
store i32 %18, i32* %13
%19 = getelementptr inbounds %struct._struct, %struct._struct* %6, i32 0, i32 1
store double 0.000000e+00, double* %19
%20 = getelementptr inbounds %struct._struct, %struct._struct* %6, i32 0, i32 2
store %struct._struct* %5, %struct._struct** %20
ret i32 1
}

LLVM IR (-O2):
%struct._struct = type { i32, double, %struct._struct* }
define i32 @main() {
ret i32 1
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ same_screen;
};
typedef TYPE_1__ XMotionEvent;

/* Variables and functions */
int get_XMotionEvent_same_screen(void *_p) {
  return (int)((XMotionEvent *)_p)->same_screen;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XMotionEvent_same_screen(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_XMotionEvent_same_screen(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void test_four(int x, int y) {
#pragma omp target
#pragma omp teams distribute simd collapse(2)
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_four>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_four+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_four+0x43>
jmp    1135 <test_four+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_four+0x24>
jmp    1148 <test_four+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_four+0x11>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_four(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %21, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %7
store i32 0, i32* %6
br label %12
12: ; preds = %17, %11
%13 = load i32, i32* %6
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %20
16: ; preds = %12
br label %17
17: ; preds = %16
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
br label %12
20: ; preds = %12
br label %21
21: ; preds = %20
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %7
24: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @test_four(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int getpid();
int g_getpid(void) { return getpid(); }


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

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

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

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


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

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

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

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