xunge/DecIR huggingface dataset:
void EnleverFinMot(char *pt_mot, int taille_mot) {
  int i = taille_mot;
  while (i > 0 && *(pt_mot + (i - 1)) == '\n') {
    i--;
    *(pt_mot + i) = '\0';
  }
}


x86 assembly (clang, -O0):
<EnleverFinMot>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x11(%rbp)
jle    113a <EnleverFinMot+0x3a>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    114a <EnleverFinMot+0x4a>
jmp    1164 <EnleverFinMot+0x64>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
jmp    1111 <EnleverFinMot+0x11>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EnleverFinMot>:
test   %esi,%esi
jle    1127 <EnleverFinMot+0x27>
mov    %esi,%eax
add    $0x1,%rax
nopw   0x0(%rax,%rax,1)
lea    -0x2(%rax),%ecx
cmpb   $0xa,(%rdi,%rcx,1)
jne    1127 <EnleverFinMot+0x27>
movb   $0x0,(%rdi,%rcx,1)
add    $0xffffffffffffffff,%rax
cmp    $0x1,%rax
ja     1110 <EnleverFinMot+0x10>
ret

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

LLVM IR (-O2):
define void @EnleverFinMot(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %13
%7 = phi i64 [ %5, %4 ], [ %8, %13 ]
%8 = add nsw i64 %7, -1
%9 = and i64 %8, 4294967295
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 10
br i1 %12, label %13, label %15
13: ; preds = %6
store i8 0, i8* %10
%14 = icmp ugt i64 %7, 1
br i1 %14, label %6, label %15
15: ; preds = %6, %13, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
char *trace() {
  do {
    printf("mintest: TRACE: "
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/marshall/mintest/refs/heads/master/tests/"
           "test_trace.c"
           ":"
           "13"
           ": "
           "\"trace me\""
           "\n");
    do {
      if (!("trace me"))
        return "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/marshall/mintest/refs/heads/"
               "master/tests/test_trace.c"
               ":"
               "13"
               ": "
               "\"trace me\"";
    } while (0);
  } while (0);
  return 0;
}


x86 assembly (clang, -O0):
<trace>:
push   %rbp
mov    %rsp,%rbp
jmp    1119 <trace+0x9>
lea    0xee0(%rip),%rdi
call   1030 <printf@plt>
jmp    112a <trace+0x1a>
jmp    112f <trace+0x1f>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [176 x i8] c"mintest: TRACE: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/marshall/mintest/refs/heads/master/tests/test_trace.c:13: \22trace me\22\0A\00"
define i8* @trace() {
br label %1
1: ; preds = %0
%2 = call i32 @printf(i8* getelementptr inbounds ([176 x i8], [176 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %1
br label %4
4: ; preds = %3
br label %5
5: ; preds = %4
ret i8* null
}

LLVM IR (-O2):
@str = [175 x i8] c"mintest: TRACE: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/marshall/mintest/refs/heads/master/tests/test_trace.c:13: \22trace me\22\00"
define noalias i8* @trace() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([175 x i8], [175 x i8]* @str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ parallel_clr_ndac(int);
int /*<<< orphan*/ parallel_set_ndac(int);
void parallel_drv2_set_ndac(unsigned char val) {
  if (val) {
    parallel_set_ndac(0x10);
  } else {
    parallel_clr_ndac(~0x10);
  }
}


x86 assembly (clang, -O0):
<parallel_drv2_set_ndac>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1147 <parallel_drv2_set_ndac+0x27>
mov    $0x10,%edi
call   1040 <parallel_set_ndac@plt>
jmp    1151 <parallel_drv2_set_ndac+0x31>
mov    $0xffffffef,%edi
call   1030 <parallel_clr_ndac@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parallel_drv2_set_ndac>:
test   %edi,%edi
je     112e <parallel_drv2_set_ndac+0xe>
mov    $0x10,%edi
jmp    1040 <parallel_set_ndac@plt>
mov    $0xffffffef,%edi
jmp    1030 <parallel_clr_ndac@plt>

LLVM IR (-O0):
define void @parallel_drv2_set_ndac(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = icmp ne i8 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @parallel_set_ndac(i32 16)
br label %9
7: ; preds = %1
%8 = call i32 @parallel_clr_ndac(i32 -17)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @parallel_drv2_set_ndac(i8 zeroext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @parallel_set_ndac(i32 16)
br label %7
5: ; preds = %1
%6 = tail call i32 @parallel_clr_ndac(i32 -17)
br label %7
7: ; preds = %5, %3
ret void
}
void f(char *c) { c == ((void *)0); }


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

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

LLVM IR (-O0):
define void @f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
%5 = zext i1 %4 to i32
ret void
}

LLVM IR (-O2):
define void @f(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ s3c2410_nand_deselect_chip();
int /*<<< orphan*/ s3c2410_nand_select_chip();
int /*<<< orphan*/ s3c2410_wait_idle();
int /*<<< orphan*/ s3c2410_write_cmd(int);
void s3c2410_nand_reset(void) {
  s3c2410_nand_select_chip();
  s3c2410_write_cmd(0xff);
  s3c2410_wait_idle();
  s3c2410_nand_deselect_chip();
}


x86 assembly (clang, -O0):
<s3c2410_nand_reset>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <s3c2410_nand_select_chip@plt>
mov    $0xff,%edi
call   1030 <s3c2410_write_cmd@plt>
mov    $0x0,%al
call   1060 <s3c2410_wait_idle@plt>
mov    $0x0,%al
call   1050 <s3c2410_nand_deselect_chip@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<s3c2410_nand_reset>:
push   %rax
xor    %eax,%eax
call   1040 <s3c2410_nand_select_chip@plt>
mov    $0xff,%edi
call   1030 <s3c2410_write_cmd@plt>
xor    %eax,%eax
call   1060 <s3c2410_wait_idle@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <s3c2410_nand_deselect_chip@plt>

LLVM IR (-O0):
define void @s3c2410_nand_reset() {
%1 = call i32 (...) @s3c2410_nand_select_chip()
%2 = call i32 @s3c2410_write_cmd(i32 255)
%3 = call i32 (...) @s3c2410_wait_idle()
%4 = call i32 (...) @s3c2410_nand_deselect_chip()
ret void
}

LLVM IR (-O2):
define void @s3c2410_nand_reset() {
%1 = tail call i32 (...) @s3c2410_nand_select_chip()
%2 = tail call i32 @s3c2410_write_cmd(i32 255)
%3 = tail call i32 (...) @s3c2410_wait_idle()
%4 = tail call i32 (...) @s3c2410_nand_deselect_chip()
ret void
}
/* Variables and functions */
void glmDiv3fv(float out[3], const float x[3], const float y[3]) {
  for (size_t i = 0; i < 3; ++i)
    out[i] = x[i] / y[i];
}


x86 assembly (clang, -O0):
<glmDiv3fv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x3,-0x20(%rbp)
jae    115b <glmDiv3fv+0x5b>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
divss  (%rax,%rcx,4),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <glmDiv3fv+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmDiv3fv>:
movss  (%rsi),%xmm0
divss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
divss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
divss  0x8(%rdx),%xmm0
movss  %xmm0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @glmDiv3fv(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fdiv float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fdiv float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %2, i64 2
%16 = load float, float* %15
%17 = fdiv float %14, %16
%18 = getelementptr inbounds float, float* %0, i64 2
store float %17, float* %18
ret void
}
double hmsc2sec(unsigned char h, unsigned char m, unsigned char s,
                unsigned char c) {
  return ((((h * 60) + m) * 60) + s) + (0.01 * c);
}


x86 assembly (clang, -O0):
<hmsc2sec>:
push   %rbp
mov    %rsp,%rbp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
movzbl -0x1(%rbp),%eax
imul   $0x3c,%eax,%eax
movzbl -0x2(%rbp),%ecx
add    %ecx,%eax
imul   $0x3c,%eax,%eax
movzbl -0x3(%rbp),%ecx
add    %ecx,%eax
cvtsi2sd %eax,%xmm1
movzbl -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xebb(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hmsc2sec>:
imul   $0x3c,%edi,%eax
add    %esi,%eax
imul   $0x3c,%eax,%eax
add    %edx,%eax
cvtsi2sd %eax,%xmm1
cvtsi2sd %ecx,%xmm0
mulsd  0xee6(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @hmsc2sec(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = mul nsw i32 %10, 60
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = add nsw i32 %11, %13
%15 = mul nsw i32 %14, 60
%16 = load i8, i8* %7
%17 = zext i8 %16 to i32
%18 = add nsw i32 %15, %17
%19 = sitofp i32 %18 to double
%20 = load i8, i8* %8
%21 = zext i8 %20 to i32
%22 = sitofp i32 %21 to double
%23 = call double @llvm.fmuladd.f64(double 1.000000e-02, double %22, double %19)
ret double %23
}

LLVM IR (-O2):
define double @hmsc2sec(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = zext i8 %0 to i32
%6 = mul nuw nsw i32 %5, 60
%7 = zext i8 %1 to i32
%8 = add nuw nsw i32 %6, %7
%9 = mul nuw nsw i32 %8, 60
%10 = zext i8 %2 to i32
%11 = add nuw nsw i32 %9, %10
%12 = sitofp i32 %11 to double
%13 = uitofp i8 %3 to double
%14 = tail call double @llvm.fmuladd.f64(double %13, double 1.000000e-02, double %12)
ret double %14
}
/* Type definitions */
struct class_device {
  int dummy;
};

/* Variables and functions */
int class_device_add(struct class_device *);
int /*<<< orphan*/ class_device_initialize(struct class_device *);
int class_device_register(struct class_device *class_dev) {
  int tmp;
  class_device_initialize(class_dev);
  tmp = class_device_add(class_dev);
  return (tmp);
}


x86 assembly (clang, -O0):
<class_device_register>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <class_device_initialize@plt>
mov    -0x8(%rbp),%rdi
call   1040 <class_device_add@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<class_device_register>:
push   %rbx
mov    %rdi,%rbx
call   1030 <class_device_initialize@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <class_device_add@plt>

LLVM IR (-O0):
%struct.class_device = type { i32 }
define i32 @class_device_register(%struct.class_device* %0) {
%2 = alloca %struct.class_device*
%3 = alloca i32
store %struct.class_device* %0, %struct.class_device** %2
%4 = load %struct.class_device*, %struct.class_device** %2
%5 = call i32 @class_device_initialize(%struct.class_device* %4)
%6 = load %struct.class_device*, %struct.class_device** %2
%7 = call i32 @class_device_add(%struct.class_device* %6)
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
%struct.class_device = type { i32 }
define i32 @class_device_register(%struct.class_device* %0) {
%2 = tail call i32 @class_device_initialize(%struct.class_device* %0)
%3 = tail call i32 @class_device_add(%struct.class_device* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ get_cpu_id();
scalar_t__ memcmp(char *, int /*<<< orphan*/, int);
int cpu_is_amd(void) {
  static char cpustr[] = "AuthenticAMD";
  return memcmp(cpustr, get_cpu_id(), 12) == 0;
}


x86 assembly (clang, -O0):
<cpu_is_amd>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <get_cpu_id@plt>
mov    %eax,%esi
lea    0x2efc(%rip),%rdi
mov    $0xc,%edx
call   1030 <memcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_is_amd>:
push   %rax
xor    %eax,%eax
call   1040 <get_cpu_id@plt>
lea    0x2f01(%rip),%rdi
mov    %eax,%esi
mov    $0xc,%edx
call   1030 <memcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@cpu_is_amd.cpustr = internal global [13 x i8] c"AuthenticAMD\00"
define i32 @cpu_is_amd() {
%1 = call i32 (...) @get_cpu_id()
%2 = call i64 @memcmp(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @cpu_is_amd.cpustr, i64 0, i64 0), i32 %1, i32 12)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
@cpu_is_amd.cpustr = internal global [13 x i8] c"AuthenticAMD\00"
define i32 @cpu_is_amd() {
%1 = tail call i32 (...) @get_cpu_id()
%2 = tail call i64 @memcmp(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @cpu_is_amd.cpustr, i64 0, i64 0), i32 %1, i32 12)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void usage(char *command) {
  printf("usage :%s ipaddr portnum filename\n", command);
  exit(0);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [35 x i8] c"usage :%s ipaddr portnum filename\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [35 x i8] c"usage :%s ipaddr portnum filename\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
void gtk_stock_add() {}


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

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

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

LLVM IR (-O2):
define void @gtk_stock_add() {
ret void
}
/* Variables and functions */
int __builtin_nyuzi_read_control_reg(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int, int, int);
void fault_handler(void) {
  printf("FAULT %d current flags %02x prev flags %02x\n",
         __builtin_nyuzi_read_control_reg(3),
         __builtin_nyuzi_read_control_reg(4),
         __builtin_nyuzi_read_control_reg(8));
  exit(0);
}


x86 assembly (clang, -O0):
<fault_handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x3,%edi
call   1040 <__builtin_nyuzi_read_control_reg@plt>
mov    %eax,-0x8(%rbp)
mov    $0x4,%edi
call   1040 <__builtin_nyuzi_read_control_reg@plt>
mov    %eax,-0x4(%rbp)
mov    $0x8,%edi
call   1040 <__builtin_nyuzi_read_control_reg@plt>
mov    -0x8(%rbp),%esi
mov    -0x4(%rbp),%edx
mov    %eax,%ecx
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<fault_handler>:
push   %rbp
push   %rbx
push   %rax
mov    $0x3,%edi
call   1040 <__builtin_nyuzi_read_control_reg@plt>
mov    %eax,%ebx
mov    $0x4,%edi
call   1040 <__builtin_nyuzi_read_control_reg@plt>
mov    %eax,%ebp
mov    $0x8,%edi
call   1040 <__builtin_nyuzi_read_control_reg@plt>
lea    0xea4(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"FAULT %d current flags %02x prev flags %02x\0A\00"
define void @fault_handler() {
%1 = call i32 @__builtin_nyuzi_read_control_reg(i32 3)
%2 = call i32 @__builtin_nyuzi_read_control_reg(i32 4)
%3 = call i32 @__builtin_nyuzi_read_control_reg(i32 8)
%4 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [45 x i8] c"FAULT %d current flags %02x prev flags %02x\0A\00"
define void @fault_handler() {
%1 = tail call i32 @__builtin_nyuzi_read_control_reg(i32 3)
%2 = tail call i32 @__builtin_nyuzi_read_control_reg(i32 4)
%3 = tail call i32 @__builtin_nyuzi_read_control_reg(i32 8)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3)
%5 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int O_CREAT;
int O_RDWR;
int O_TRUNC;
int /*<<< orphan*/ open(char *, int, int);
int main(int argc, char **argv) {
  open("/tmp/moo", O_RDWR | O_CREAT | O_TRUNC, 0666);
  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)
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
mov    0x2ec2(%rip),%rax
or     (%rax),%esi
mov    0x2eb1(%rip),%rax
or     (%rax),%esi
lea    0xeb8(%rip),%rdi
mov    $0x1b6,%edx
call   1030 <open@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    0x2ed9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2ec6(%rip),%rax
or     (%rax),%esi
lea    0xecd(%rip),%rdi
mov    $0x1b6,%edx
call   1030 <open@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [9 x i8] c"/tmp/moo\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
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 = load i32, i32* @O_RDWR
%7 = load i32, i32* @O_CREAT
%8 = or i32 %6, %7
%9 = load i32, i32* @O_TRUNC
%10 = or i32 %8, %9
%11 = call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %10, i32 438)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"/tmp/moo\00"
@O_RDWR = global i32 0
@O_CREAT = global i32 0
@O_TRUNC = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = load i32, i32* @O_RDWR
%4 = load i32, i32* @O_CREAT
%5 = or i32 %4, %3
%6 = load i32, i32* @O_TRUNC
%7 = or i32 %5, %6
%8 = tail call i32 @open(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %7, i32 438)
ret i32 0
}
void pd_set_pins_speed(void) {}


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

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

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

LLVM IR (-O2):
define void @pd_set_pins_speed() {
ret void
}
/* Type definitions */
typedef scalar_t__ RAND_MAX;

/* Variables and functions */
scalar_t__ rand();
double drand48() { return ((double)rand()) / ((double)(RAND_MAX) + 1.0); }


x86 assembly (clang, -O0):
<drand48>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
movsd  0xed8(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<drand48>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @drand48() {
%1 = call i64 (...) @rand()
%2 = sitofp i64 %1 to double
%3 = fdiv double %2, 1.000000e+00
ret double %3
}

LLVM IR (-O2):
define double @drand48() {
%1 = tail call i64 (...) @rand()
%2 = sitofp i64 %1 to double
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ic(void) { printf("India, China"); }


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

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

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

LLVM IR (-O2):
@.str = [13 x i8] c"India, China\00"
define void @ic() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret void
}
void gdk_color_free() {}


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

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

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

LLVM IR (-O2):
define void @gdk_color_free() {
ret void
}
void skipbyte(char c) { ; }


x86 assembly (clang, -O0):
<skipbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @skipbyte(i8 signext %0) {
ret void
}
/* Type definitions */
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Cyc_Absyndump_dumpexp_prec(int /*<<< orphan*/,
                                              struct Cyc_Absyn_Exp *);
void Cyc_Absyndump_dumpexp(struct Cyc_Absyn_Exp *e) {
  ({ Cyc_Absyndump_dumpexp_prec(0, e); });
}


x86 assembly (clang, -O0):
<Cyc_Absyndump_dumpexp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
xor    %edi,%edi
call   1030 <Cyc_Absyndump_dumpexp_prec@plt>
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Absyndump_dumpexp>:
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <Cyc_Absyndump_dumpexp_prec@plt>

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

LLVM IR (-O2):
%struct.Cyc_Absyn_Exp = type { i32 }
define void @Cyc_Absyndump_dumpexp(%struct.Cyc_Absyn_Exp* %0) {
%2 = tail call i32 @Cyc_Absyndump_dumpexp_prec(i32 0, %struct.Cyc_Absyn_Exp* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
uint8_t zig_addw_u8(uint8_t lhs, uint8_t rhs, uint8_t max) {
  uint8_t thresh = max - rhs;
  if (lhs > thresh) {
    return lhs - thresh - 1;
  } else {
    return lhs + rhs;
  }
}


x86 assembly (clang, -O0):
<zig_addw_u8>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x28(%rbp),%rax
jle    113f <zig_addw_u8+0x3f>
mov    -0x10(%rbp),%rax
sub    -0x28(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    114b <zig_addw_u8+0x4b>
mov    -0x10(%rbp),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<zig_addw_u8>:
sub    %rsi,%rdx
cmp    %rdi,%rdx
not    %rdx
cmovge %rsi,%rdx
lea    (%rdx,%rdi,1),%rax
ret

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

LLVM IR (-O2):
define i64 @zig_addw_u8(i64 %0, i64 %1, i64 %2) {
%4 = sub nsw i64 %2, %1
%5 = icmp slt i64 %4, %0
%6 = xor i64 %4, -1
%7 = select i1 %5, i64 %6, i64 %1
%8 = add i64 %7, %0
ret i64 %8
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int type;
};
typedef TYPE_1__ XFocusChangeEvent;

/* Variables and functions */
void set_XFocusChangeEvent_type(void *_p, int _v) {
  ((XFocusChangeEvent *)_p)->type = (int)_v;
}


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

x86 assembly (clang, -O2):
<set_XFocusChangeEvent_type>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_XFocusChangeEvent_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int some_undefined_func();
int bar_system_value(void) { return some_undefined_func(); }


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

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

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

LLVM IR (-O2):
define i32 @bar_system_value() {
%1 = tail call i32 (...) @some_undefined_func()
ret i32 %1
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ perror(char *);
int infile_close(int fd) {
  if (close(fd) == -1) {
    perror("Can't close input file");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<infile_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1154 <infile_close+0x34>
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
movl   $0x1,-0x4(%rbp)
jmp    115b <infile_close+0x3b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<infile_close>:
push   %rax
call   1030 <close@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0xffffffff,%ecx
je     1131 <infile_close+0x11>
pop    %rcx
ret
lea    0xec8(%rip),%rdi
call   1040 <perror@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Can't close input file\00"
define i32 @infile_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i32 @close(i32 %4)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %2
br label %10
9: ; preds = %1
store i32 0, i32* %2
br label %10
10: ; preds = %9, %7
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
@.str = [23 x i8] c"Can't close input file\00"
define i32 @infile_close(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @perror(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void func_normal() { puts("normal function"); }


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

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

LLVM IR (-O0):
@.str = [16 x i8] c"normal function\00"
define void @func_normal() {
%1 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [16 x i8] c"normal function\00"
define void @func_normal() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
scalar_t__ common_keypress_handler(int);
void text_keypress(int key) {
  if (common_keypress_handler(key))
    return;
  switch (key) {}
}


x86 assembly (clang, -O0):
<text_keypress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <common_keypress_handler@plt>
cmp    $0x0,%rax
je     1132 <text_keypress+0x22>
jmp    1132 <text_keypress+0x22>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<text_keypress>:
jmp    1030 <common_keypress_handler@plt>

LLVM IR (-O0):
define void @text_keypress(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @common_keypress_handler(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
br label %9
7: ; preds = %1
%8 = load i32, i32* %2
switch i32 %8, label %9 [
]
9: ; preds = %6, %7
ret void
}

LLVM IR (-O2):
define void @text_keypress(i32 %0) {
%2 = tail call i64 @common_keypress_handler(i32 %0)
ret void
}
int ISBLANK(int c) { return (c == ' ' || c == '\t'); }


x86 assembly (clang, -O0):
<ISBLANK>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    $0x1,%al
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
je     1120 <ISBLANK+0x20>
cmpl   $0x9,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ISBLANK>:
cmp    $0x20,%edi
sete   %al
cmp    $0x9,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ISBLANK(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp eq i32 %6, 9
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ true, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ISBLANK(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = icmp eq i32 %0, 9
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
void compiler_barrier(void) { __asm__ volatile("" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @compiler_barrier() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ FreeMemory(void *);
void Z_Free(void *ptr) { FreeMemory(ptr); }


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

x86 assembly (clang, -O2):
<Z_Free>:
jmp    1030 <FreeMemory@plt>

LLVM IR (-O0):
define void @Z_Free(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @FreeMemory(i8* %3)
ret void
}

LLVM IR (-O2):
define void @Z_Free(i8* %0) {
%2 = tail call i32 @FreeMemory(i8* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int search(int *, int, int);
int main(void) {
  int arr[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 10, 10, 11, 11, 12};
  printf("%d\n", search(arr, sizeof(arr), 10));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x3c,%edx
call   1050 <memcpy@plt>
lea    -0x40(%rbp),%rdi
mov    $0x3c,%esi
mov    $0xa,%edx
call   1040 <search@plt>
mov    %eax,%esi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movups 0xf01(%rip),%xmm0
movups %xmm0,0x2c(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeb1(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x3c,%esi
mov    $0xa,%edx
call   1040 <search@plt>
lea    0xed0(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

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

LLVM IR (-O2):
@__const.main.arr = [15 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 10, i32 10, i32 11, i32 11, i32 12]
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [15 x i32]
%2 = bitcast [15 x i32]* %1 to i8*
%3 = getelementptr inbounds [15 x i32], [15 x i32]* %1, i64 0, i64 0
%4 = call i32 @search(i32* %3, i32 60, i32 10)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Variables and functions */
int strcmp(char const *, char const *);
int cmp_string(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
}


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

x86 assembly (clang, -O2):
<cmp_string>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @cmp_string(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 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i8**
%10 = load i8*, i8** %9
%11 = call i32 @strcmp(i8* %7, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @cmp_string(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = load i8*, i8** %3
%5 = bitcast i8* %1 to i8**
%6 = load i8*, i8** %5
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %4, i8* dereferenceable(1) %6)
ret i32 %7
}
/* Type definitions */
struct SocketBuffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ buffWrite(short *, int, struct SocketBuffer *);
void writeShort(short value, struct SocketBuffer *buff) {
  buffWrite(&value, sizeof(short), buff);
}


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

x86 assembly (clang, -O2):
<writeShort>:
push   %rax
mov    %rsi,%rdx
mov    %di,0x6(%rsp)
lea    0x6(%rsp),%rdi
mov    $0x2,%esi
call   1030 <buffWrite@plt>
pop    %rax
ret

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

LLVM IR (-O2):
%struct.SocketBuffer = type { i32 }
define void @writeShort(i16 signext %0, %struct.SocketBuffer* %1) {
%3 = alloca i16
store i16 %0, i16* %3
%4 = call i32 @buffWrite(i16* %3, i32 2, %struct.SocketBuffer* %1)
ret void
}
/* Type definitions */
struct typed_value {
  int dummy;
};
struct inter {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ typed_value_destruct(struct typed_value *, struct inter *);
void typed_value_destruct_(struct inter *inter, struct typed_value *self) {
  typed_value_destruct(self, inter);
}


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

x86 assembly (clang, -O2):
<typed_value_destruct_>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <typed_value_destruct@plt>

LLVM IR (-O0):
%struct.inter = type { i32 }
%struct.typed_value = type { i32 }
define void @typed_value_destruct_(%struct.inter* %0, %struct.typed_value* %1) {
%3 = alloca %struct.inter*
%4 = alloca %struct.typed_value*
store %struct.inter* %0, %struct.inter** %3
store %struct.typed_value* %1, %struct.typed_value** %4
%5 = load %struct.typed_value*, %struct.typed_value** %4
%6 = load %struct.inter*, %struct.inter** %3
%7 = call i32 @typed_value_destruct(%struct.typed_value* %5, %struct.inter* %6)
ret void
}

LLVM IR (-O2):
%struct.inter = type { i32 }
%struct.typed_value = type { i32 }
define void @typed_value_destruct_(%struct.inter* %0, %struct.typed_value* %1) {
%3 = tail call i32 @typed_value_destruct(%struct.typed_value* %1, %struct.inter* %0)
ret void
}
int PyDTrace_IMPORT_FIND_LOAD_DONE_ENABLED(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @PyDTrace_IMPORT_FIND_LOAD_DONE_ENABLED() {
ret i32 0
}
void freehostent(struct hostent *ip) {}


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

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

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

LLVM IR (-O2):
%struct.hostent = type opaque
define void @freehostent(%struct.hostent* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void(pavl_item_free)(void *item, void *unused_param) {
  if (item)
    free(item);
}


x86 assembly (clang, -O0):
<pavl_item_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <pavl_item_free+0x24>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pavl_item_free>:
test   %rdi,%rdi
je     111a <pavl_item_free+0xa>
jmp    1030 <free@plt>
ret

LLVM IR (-O0):
define void @pavl_item_free(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 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i8*, i8** %3
%9 = call i32 @free(i8* %8)
br label %10
10: ; preds = %7, %2
ret void
}

LLVM IR (-O2):
define void @pavl_item_free(i8* %0, i8* nocapture readnone %1) {
%3 = icmp eq i8* %0, null
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = tail call i32 @free(i8* %0)
br label %6
6: ; preds = %4, %2
ret void
}
/* Variables and functions */
float __nv_fmul_rz(float, float);
float __fmul_rz(float __a, float __b) { return __nv_fmul_rz(__a, __b); }


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

x86 assembly (clang, -O2):
<__fmul_rz>:
jmp    1030 <__nv_fmul_rz@plt>

LLVM IR (-O0):
define float @__fmul_rz(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = call float @__nv_fmul_rz(float %5, float %6)
ret float %7
}

LLVM IR (-O2):
define float @__fmul_rz(float %0, float %1) {
%3 = tail call float @__nv_fmul_rz(float %0, float %1)
ret float %3
}
int is_printable(int c) {
  if (c < ' ' || c > '~')
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<is_printable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x20,-0x8(%rbp)
jl     111b <is_printable+0x1b>
cmpl   $0x7e,-0x8(%rbp)
jle    1127 <is_printable+0x27>
movl   $0x0,-0x4(%rbp)
jmp    112e <is_printable+0x2e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_printable>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x5f,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @is_printable(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 32
br i1 %5, label %9, label %6
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sgt i32 %7, 126
br i1 %8, label %9, label %10
9: ; preds = %6, %1
store i32 0, i32* %2
br label %11
10: ; preds = %6
store i32 1, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @is_printable(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 95
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ c_free(void *);
void destroy_tls_state_cb(void *tls_data) { c_free(tls_data); }


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

x86 assembly (clang, -O2):
<destroy_tls_state_cb>:
jmp    1030 <c_free@plt>

LLVM IR (-O0):
define void @destroy_tls_state_cb(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @c_free(i8* %3)
ret void
}

LLVM IR (-O2):
define void @destroy_tls_state_cb(i8* %0) {
%2 = tail call i32 @c_free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int main() {
  int i;
  fprintf(stderr, "addr=%p, size=%ld\n", &i, sizeof i);
#pragma omp target enter data map(alloc : i)
#pragma omp target enter data map(present, alloc : i)
#pragma omp target exit data map(delete : i)
  fprintf(stderr, "i is present\n");
#pragma omp target enter data map(present, alloc : i)
  fprintf(stderr, "i is present\n");
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
mov    0x2ec5(%rip),%r14
mov    (%r14),%edi
lea    0xedb(%rip),%rsi
lea    0x4(%rsp),%rdx
mov    $0x4,%ecx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xed3(%rip),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [19 x i8] c"addr=%p, size=%ld\0A\00"
@.str.1 = [14 x i8] c"i is present\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32* %2, i64 4)
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [19 x i8] c"addr=%p, size=%ld\0A\00"
@.str.1 = [14 x i8] c"i is present\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = load i32, i32* @stderr
%4 = call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32* %1, i64 4)
%5 = load i32, i32* @stderr
%6 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* @stderr
%8 = call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
double JetPaletteBase(double);
double JetPaletteRed(double gray) { return JetPaletteBase(gray - 0.5); }


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

x86 assembly (clang, -O2):
<JetPaletteRed>:
addsd  0xee8(%rip),%xmm0
jmp    1030 <JetPaletteBase@plt>

LLVM IR (-O0):
define double @JetPaletteRed(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fsub double %3, 5.000000e-01
%5 = call double @JetPaletteBase(double %4)
ret double %5
}

LLVM IR (-O2):
define double @JetPaletteRed(double %0) {
%2 = fadd double %0, -5.000000e-01
%3 = tail call double @JetPaletteBase(double %2)
ret double %3
}