xunge/DecIR huggingface dataset:
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  int type;
};
struct TYPE_4__ {
  TYPE_1__ xmaprequest;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
void set_XEvent_xmaprequest_type(void *_p, int _v) {
  ((XEvent *)_p)->xmaprequest.type = (int)_v;
}


x86 assembly (clang, -O0):
<set_XEvent_xmaprequest_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_XEvent_xmaprequest_type>:
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32 }
define void @set_XEvent_xmaprequest_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_4__*
%8 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %7, i32 0, i32 0
%9 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %8, i32 0, i32 0
store i32 %5, i32* %9
ret void
}

LLVM IR (-O2):
define void @set_XEvent_xmaprequest_type(i8* nocapture writeonly %0, i32 %1) {
%3 = bitcast i8* %0 to i32*
store i32 %1, i32* %3
ret void
}
/* Variables and functions */
int fwrite(void const *, int, size_t, void *);
int write_fp(const void *data, size_t len, void *fp) {
  return fwrite(data, 1, len, fp);
}


x86 assembly (clang, -O0):
<write_fp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x1,%esi
call   1030 <fwrite@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_fp>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    $0x1,%esi
jmp    1030 <fwrite@plt>

LLVM IR (-O0):
define i32 @write_fp(i8* %0, i64 %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i8*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i8*, i8** %6
%10 = call i32 @fwrite(i8* %7, i32 1, i64 %8, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @write_fp(i8* nocapture %0, i64 %1, i8* nocapture %2) {
%4 = tail call i32 @fwrite(i8* %0, i32 1, i64 %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ intro();
int /*<<< orphan*/ new_game();
int main(void) {
  intro();
  new_game();
  return (0);
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @intro()
%2 = tail call i32 (...) @new_game()
ret i32 0
}
int INHERENT_fchown() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @INHERENT_fchown() {
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t single_bit(int index) { return ((uint64_t)1) << index; }


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

x86 assembly (clang, -O2):
<single_bit>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
ret

LLVM IR (-O0):
define i32 @single_bit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = shl i32 1, %3
ret i32 %4
}

LLVM IR (-O2):
define i32 @single_bit(i32 %0) {
%2 = shl nuw i32 1, %0
ret i32 %2
}
void av_buffer_pool_buffer_get_opaque() {}


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

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

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

LLVM IR (-O2):
define void @av_buffer_pool_buffer_get_opaque() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print() { printf("HelloWorld!\n"); }


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

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

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

LLVM IR (-O2):
@str = [12 x i8] c"HelloWorld!\00"
define void @print() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct drm_file {
  int dummy;
};
struct drm_device {
  int dummy;
};

/* Variables and functions */
int drm_agp_release(struct drm_device *);
int drm_agp_release_ioctl(struct drm_device *dev, void *data,
                          struct drm_file *file_priv) {
  return drm_agp_release(dev);
}


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

x86 assembly (clang, -O2):
<drm_agp_release_ioctl>:
jmp    1030 <drm_agp_release@plt>

LLVM IR (-O0):
%struct.drm_device = type { i32 }
%struct.drm_file = type { i32 }
define i32 @drm_agp_release_ioctl(%struct.drm_device* %0, i8* %1, %struct.drm_file* %2) {
%4 = alloca %struct.drm_device*
%5 = alloca i8*
%6 = alloca %struct.drm_file*
store %struct.drm_device* %0, %struct.drm_device** %4
store i8* %1, i8** %5
store %struct.drm_file* %2, %struct.drm_file** %6
%7 = load %struct.drm_device*, %struct.drm_device** %4
%8 = call i32 @drm_agp_release(%struct.drm_device* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.drm_device = type { i32 }
%struct.drm_file = type { i32 }
define i32 @drm_agp_release_ioctl(%struct.drm_device* %0, i8* nocapture readnone %1, %struct.drm_file* nocapture readnone %2) {
%4 = tail call i32 @drm_agp_release(%struct.drm_device* %0)
ret i32 %4
}
c_opener__(bb) char bb[];
{ return (creat(bb, 0644)); }


x86 assembly (clang, -O0):
<c_opener__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1a4,%esi
mov    $0x0,%al
call   1030 <creat@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_opener__>:
mov    $0x1a4,%esi
xor    %eax,%eax
jmp    1030 <creat@plt>

LLVM IR (-O0):
define i32 @c_opener__(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @creat to i32 (i8*, i32, ...)*)(i8* %3, i32 420)
ret i32 %4
}

LLVM IR (-O2):
define i32 @c_opener__(i8* %0) {
%2 = tail call i32 (i8*, i32, ...) bitcast (i32 (...)* @creat to i32 (i8*, i32, ...)*)(i8* %0, i32 420)
ret i32 %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mp2vpicx_set_chroma420(uint8_t *p_mp2vpicx) { p_mp2vpicx[7] |= 0x1; }


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

x86 assembly (clang, -O2):
<mp2vpicx_set_chroma420>:
orb    $0x1,0x1c(%rdi)
ret

LLVM IR (-O0):
define void @mp2vpicx_set_chroma420(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 7
%5 = load i32, i32* %4
%6 = or i32 %5, 1
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @mp2vpicx_set_chroma420(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 7
%3 = load i32, i32* %2
%4 = or i32 %3, 1
store i32 %4, i32* %2
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ GLfloat;

/* Variables and functions */
int /*<<< orphan*/ glVertex2f(int /*<<< orphan*/, int /*<<< orphan*/);
void Vertex2f(GLfloat x, GLfloat y) { glVertex2f(x, y); }


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

x86 assembly (clang, -O2):
<Vertex2f>:
jmp    1030 <glVertex2f@plt>

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

LLVM IR (-O2):
define void @Vertex2f(i32 %0, i32 %1) {
%3 = tail call i32 @glVertex2f(i32 %0, i32 %1)
ret void
}
/* Variables and functions */
unsigned char *zmalloc(int);
unsigned char *zipmapXNew(void) {
  unsigned char *zm = zmalloc(2);
  zm[0] = 0;
  zm[1] = 255;
  return zm;
}


x86 assembly (clang, -O0):
<zipmapXNew>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x2,%edi
call   1030 <zmalloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x8(%rbp),%rax
movb   $0xff,0x1(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zipmapXNew>:
push   %rax
mov    $0x2,%edi
call   1030 <zmalloc@plt>
movw   $0xff00,(%rax)
pop    %rcx
ret

LLVM IR (-O0):
define i8* @zipmapXNew() {
%1 = alloca i8*
%2 = call i8* @zmalloc(i32 2)
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = getelementptr inbounds i8, i8* %3, i64 0
store i8 0, i8* %4
%5 = load i8*, i8** %1
%6 = getelementptr inbounds i8, i8* %5, i64 1
store i8 -1, i8* %6
%7 = load i8*, i8** %1
ret i8* %7
}

LLVM IR (-O2):
define i8* @zipmapXNew() {
%1 = tail call i8* @zmalloc(i32 2)
store i8 0, i8* %1
%2 = getelementptr inbounds i8, i8* %1, i64 1
store i8 -1, i8* %2
ret i8* %1
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ fork();
int /*<<< orphan*/ forkChild(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  pid_t f = fork();
  forkChild(f);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <fork@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <forkChild@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <fork@plt>
mov    %eax,%edi
call   1030 <forkChild@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
%6 = call i32 (...) @fork()
store i32 %6, i32* %5
%7 = load i32, i32* %5
%8 = call i32 @forkChild(i32 %7)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @fork()
%4 = tail call i32 @forkChild(i32 %3)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ oosmos_DelayUS(int);
extern void oosmos_DelayMS(uint32_t MS) { oosmos_DelayUS(MS * 1000); }


x86 assembly (clang, -O0):
<oosmos_DelayMS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
imul   $0x3e8,-0x4(%rbp),%edi
call   1030 <oosmos_DelayUS@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<oosmos_DelayMS>:
imul   $0x3e8,%edi,%edi
jmp    1030 <oosmos_DelayUS@plt>

LLVM IR (-O0):
define void @oosmos_DelayMS(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul nsw i32 %3, 1000
%5 = call i32 @oosmos_DelayUS(i32 %4)
ret void
}

LLVM IR (-O2):
define void @oosmos_DelayMS(i32 %0) {
%2 = mul nsw i32 %0, 1000
%3 = tail call i32 @oosmos_DelayUS(i32 %2)
ret void
}
int test_47_4(int *mem) { return __atomic_and_fetch(mem + 0, 1, 4); }


x86 assembly (clang, -O0):
<test_47_4>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%esi
mov    %eax,%edx
and    %esi,%edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x24(%rbp)
test   $0x1,%cl
mov    %eax,-0x14(%rbp)
jne    114b <test_47_4+0x4b>
jmp    1122 <test_47_4+0x22>
mov    -0x18(%rbp),%ecx
mov    -0x24(%rbp),%eax
and    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_47_4>:
mov    (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
and    $0x1,%ecx
lock cmpxchg %ecx,(%rdi)
jne    1110 <test_47_4+0x10>
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @test_47_4(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 0
store i32 1, i32* %3
%7 = load i32, i32* %3
%8 = atomicrmw and i32* %6, i32 %7 acq_rel
%9 = and i32 %8, %7
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret i32 %10
}

LLVM IR (-O2):
define i32 @test_47_4(i32* nocapture %0) {
%2 = atomicrmw and i32* %0, i32 1 acq_rel
%3 = and i32 %2, 1
ret i32 %3
}
long next_square_num(void) {
  static long last_index = 0;
  last_index++;
  return last_index * last_index;
}


x86 assembly (clang, -O0):
<next_square_num>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f1d(%rip),%rax
add    $0x1,%rax
mov    %rax,0x2f12(%rip)
mov    0x2f0b(%rip),%rax
imul   0x2f03(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<next_square_num>:
mov    0x2f21(%rip),%rax
add    $0x1,%rax
mov    %rax,0x2f16(%rip)
imul   %rax,%rax
ret

LLVM IR (-O0):
@next_square_num.last_index = internal global i64 0
define i64 @next_square_num() {
%1 = load i64, i64* @next_square_num.last_index
%2 = add nsw i64 %1, 1
store i64 %2, i64* @next_square_num.last_index
%3 = load i64, i64* @next_square_num.last_index
%4 = load i64, i64* @next_square_num.last_index
%5 = mul nsw i64 %3, %4
ret i64 %5
}

LLVM IR (-O2):
@next_square_num.last_index = internal unnamed_addr global i64 0
define i64 @next_square_num() {
%1 = load i64, i64* @next_square_num.last_index
%2 = add nsw i64 %1, 1
store i64 %2, i64* @next_square_num.last_index
%3 = mul nsw i64 %2, %2
ret i64 %3
}
unsigned addval_255(unsigned x) { return x + 3351415099U; }


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

x86 assembly (clang, -O2):
<addval_255>:
lea    -0x383d76c5(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @addval_255(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add i32 %3, -943552197
ret i32 %4
}

LLVM IR (-O2):
define i32 @addval_255(i32 %0) {
%2 = add i32 %0, -943552197
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  do {
    scanf("%d", &n);
    if (n == 0)
      break;
    printf("%d\n", n);
  } while (1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    114e <main+0x2e>
jmp    116c <main+0x4c>
mov    -0x8(%rbp),%esi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%al
test   $0x1,%al
jne    112f <main+0xf>
jmp    116c <main+0x4c>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
je     117b <main+0x5b>
lea    0xeba(%rip),%r14
lea    0xeb0(%rip),%r15
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
test   %esi,%esi
jne    1160 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 0
br i1 %5, label %12, label %6
6: ; preds = %0, %6
%7 = phi i32 [ %10, %6 ], [ %4, %0 ]
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %6
12: ; preds = %6, %0
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ err();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void *child_fn(void *arg) {
  fprintf(stderr, "\n--------- c: start (expect 1) ---------\n\n");
  err();
  fprintf(stderr, "\n--------- c: end ---------\n\n");
  return NULL;
}


x86 assembly (clang, -O0):
<child_fn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
lea    0xec4(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x0,%al
call   1040 <err@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xed3(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<child_fn>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
call   1040 <err@plt>
mov    (%rbx),%edi
lea    0xee5(%rip),%rsi
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [43 x i8] c"\0A--------- c: start (expect 1) ---------\0A\0A\00"
@.str.1 = [30 x i8] c"\0A--------- c: end ---------\0A\0A\00"
define i8* @child_fn(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @err()
%6 = load i32, i32* @stderr
%7 = call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [43 x i8] c"\0A--------- c: start (expect 1) ---------\0A\0A\00"
@.str.1 = [30 x i8] c"\0A--------- c: end ---------\0A\0A\00"
define noalias i8* @child_fn(i8* nocapture readnone %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @err()
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ wait(int /*<<< orphan*/ *);
void wait_child(int sing) { wait(NULL); }


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

x86 assembly (clang, -O2):
<wait_child>:
xor    %edi,%edi
jmp    1030 <wait@plt>

LLVM IR (-O0):
define void @wait_child(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @wait(i32* null)
ret void
}

LLVM IR (-O2):
define void @wait_child(i32 %0) {
%2 = tail call i32 @wait(i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
int FreeHost(void *hstPtr) {
  free(hstPtr);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @FreeHost(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ JackknifeEstimations(int, double *);
int llegeixx(double **);
int main(int argc, char *argv[]) {
  double *dades;
  int N;
  N = llegeixx(&dades);
  JackknifeEstimations(N, dades);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
call   1030 <llegeixx@plt>
mov    (%rsp),%rsi
mov    %eax,%edi
call   1040 <JackknifeEstimations@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double*
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 @llegeixx(double** %6)
store i32 %8, i32* %7
%9 = load i32, i32* %7
%10 = load double*, double** %6
%11 = call i32 @JackknifeEstimations(i32 %9, double* %10)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca double*
%4 = bitcast double** %3 to i8*
%5 = call i32 @llegeixx(double** %3)
%6 = load double*, double** %3
%7 = call i32 @JackknifeEstimations(i32 %5, double* %6)
ret i32 0
}
int test_imm_53uint64_midword_reg(unsigned long long val) {
  return ((val >> 16) & (0x53 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_53uint64_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, 83
%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_53uint64_midword_reg(i64 %0) {
%2 = and i64 %0, 5439488
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void audit_close(int fd) {
  if (fd >= 0)
    close(fd);
}


x86 assembly (clang, -O0):
<audit_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     112d <audit_close+0x1d>
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<audit_close>:
test   %edi,%edi
js     1119 <audit_close+0x9>
jmp    1030 <close@plt>
ret

LLVM IR (-O0):
define void @audit_close(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = call i32 @close(i32 %6)
br label %8
8: ; preds = %5, %1
ret void
}

LLVM IR (-O2):
define void @audit_close(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int booster_fxstat(int, int, void *);
int __fxstat(int ver, int fd, void *buf) {
  return booster_fxstat(ver, fd, buf);
}


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

x86 assembly (clang, -O2):
<__fxstat>:
jmp    1030 <booster_fxstat@plt>

LLVM IR (-O0):
define i32 @__fxstat(i32 %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call i32 @booster_fxstat(i32 %7, i32 %8, i8* %9)
ret i32 %10
}

LLVM IR (-O2):
define i32 @__fxstat(i32 %0, i32 %1, i8* %2) {
%4 = tail call i32 @booster_fxstat(i32 %0, i32 %1, i8* %2)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int isatty(int);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("stdin:  %d\n", isatty(0));
  printf("stdout: %d\n", isatty(1));
  printf("stderr: %d\n", isatty(2));
  exit(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)
xor    %edi,%edi
call   1030 <isatty@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1030 <isatty@plt>
mov    %eax,%esi
lea    0xe9e(%rip),%rdi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1030 <isatty@plt>
mov    %eax,%esi
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1030 <isatty@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x1,%edi
call   1030 <isatty@plt>
lea    0xeb5(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x2,%edi
call   1030 <isatty@plt>
lea    0xea9(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"stdin: %d\0A\00"
@.str.1 = [12 x i8] c"stdout: %d\0A\00"
@.str.2 = [12 x i8] c"stderr: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @isatty(i32 0)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @isatty(i32 1)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @isatty(i32 2)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = tail call i32 @exit(i32 0)
unreachable
}
int foo(int a, int b) { return 0; }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @foo(i32 %0, i32 %1) {
ret i32 0
}
char *ft_strupper(char *s) {
  char *str;
  str = s;
  while (*s != '\0') {
    if ((*s >= 'a') && (*s <= 'z')) {
      *s -= 32;
    }
    s++;
  }
  return str;
}


x86 assembly (clang, -O0):
<ft_strupper>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115d <ft_strupper+0x5d>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x61,%eax
jl     114c <ft_strupper+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x7a,%eax
jg     114c <ft_strupper+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
sub    $0x20,%ecx
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1110 <ft_strupper+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strupper>:
mov    %rdi,%rax
mov    (%rdi),%cl
test   %cl,%cl
je     112c <ft_strupper+0x2c>
lea    0x1(%rax),%rdx
jmp    111b <ft_strupper+0x1b>
nop
movzbl (%rdx),%ecx
add    $0x1,%rdx
test   %cl,%cl
je     112c <ft_strupper+0x2c>
lea    -0x61(%rcx),%esi
cmp    $0x19,%sil
ja     1110 <ft_strupper+0x10>
add    $0xe0,%cl
mov    %cl,-0x1(%rdx)
jmp    1110 <ft_strupper+0x10>
ret

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

LLVM IR (-O2):
define i8* @ft_strupper(i8* returned %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %11
%5 = phi i8 [ %13, %11 ], [ %2, %1 ]
%6 = phi i8* [ %12, %11 ], [ %0, %1 ]
%7 = add i8 %5, -97
%8 = icmp ult i8 %7, 26
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = add nsw i8 %5, -32
store i8 %10, i8* %6
br label %11
11: ; preds = %9, %4
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %11, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
fun2() { printf("fflag 2"); }


x86 assembly (clang, -O0):
<fun2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [8 x i8] c"fflag 2\00"
define i32 @fun2() {
%1 = alloca i32
%2 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [8 x i8] c"fflag 2\00"
define i32 @fun2() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
void tr_add(void *addr, int len) {}


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

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

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

LLVM IR (-O2):
define void @tr_add(i8* nocapture %0, i32 %1) {
ret void
}
int d_le_mr1(double *a1, double a2) { return (((*a1) <= (a2))); }


x86 assembly (clang, -O0):
<d_le_mr1>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
setae  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_le_mr1>:
xor    %eax,%eax
ucomisd (%rdi),%xmm0
setae  %al
ret

LLVM IR (-O0):
define i32 @d_le_mr1(double* %0, double %1) {
%3 = alloca double*
%4 = alloca double
store double* %0, double** %3
store double %1, double* %4
%5 = load double*, double** %3
%6 = load double, double* %5
%7 = load double, double* %4
%8 = fcmp ole double %6, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @d_le_mr1(double* nocapture %0, double %1) {
%3 = load double, double* %0
%4 = fcmp ole double %3, %1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ omp_get_num_procs();
double sum_omp_tasks_maxthreads(double *, int, int, int /*<<< orphan*/);
double sum_omp(double *v, int low, int high) {
  double s = 0;
#pragma omp parallel
  {
#pragma omp single nowait
    s = sum_omp_tasks_maxthreads(v, low, high, omp_get_num_procs());
  }
  return s;
}


x86 assembly (clang, -O0):
<sum_omp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <omp_get_num_procs@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
call   1040 <sum_omp_tasks_maxthreads@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum_omp>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <omp_get_num_procs@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %eax,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <sum_omp_tasks_maxthreads@plt>

LLVM IR (-O0):
define double @sum_omp(double* %0, i32 %1, i32 %2) {
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
store double* %0, double** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store double 0.000000e+00, double* %7
%8 = load double*, double** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 (...) @omp_get_num_procs()
%12 = call double @sum_omp_tasks_maxthreads(double* %8, i32 %9, i32 %10, i32 %11)
store double %12, double* %7
%13 = load double, double* %7
ret double %13
}

LLVM IR (-O2):
define double @sum_omp(double* %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @omp_get_num_procs()
%5 = tail call double @sum_omp_tasks_maxthreads(double* %0, i32 %1, i32 %2, i32 %4)
ret double %5
}
/* Variables and functions */
int add(char *);
bool add_test_one_number() {
  if (add("5") == 5)
    return true;
  return false;
}


x86 assembly (clang, -O0):
<add_test_one_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <add@plt>
cmp    $0x5,%eax
jne    1139 <add_test_one_number+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1140 <add_test_one_number+0x30>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<add_test_one_number>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <add@plt>
xor    %ecx,%ecx
cmp    $0x5,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"5\00"
define i32 @add_test_one_number() {
%1 = tail call i32 @add(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = icmp eq i32 %1, 5
%3 = zext i1 %2 to i32
ret i32 %3
}
unsigned long insert_ras(unsigned long insn, long value, int dialect,
                         const char **errmsg) {
  if (value == 0)
    *errmsg = ("invalid register operand when updating");
  return insn | ((value & 0x1f) << 16);
}


x86 assembly (clang, -O0):
<insert_ras>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    112c <insert_ras+0x2c>
mov    -0x20(%rbp),%rax
lea    0xed7(%rip),%rcx
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
and    $0x1f,%rcx
shl    $0x10,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_ras>:
mov    %rsi,%rax
test   %rsi,%rsi
jne    1112 <insert_ras+0x12>
lea    0xef1(%rip),%rdx
mov    %rdx,(%rcx)
and    $0x1f,%eax
shl    $0x10,%rax
or     %rdi,%rax
ret

LLVM IR (-O0):
@.str = [39 x i8] c"invalid register operand when updating\00"
define i64 @insert_ras(i64 %0, i64 %1, i32 %2, i8** %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32
%8 = alloca i8**
store i64 %0, i64* %5
store i64 %1, i64* %6
store i32 %2, i32* %7
store i8** %3, i8*** %8
%9 = load i64, i64* %6
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = load i8**, i8*** %8
store i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8** %12
br label %13
13: ; preds = %11, %4
%14 = load i64, i64* %5
%15 = load i64, i64* %6
%16 = and i64 %15, 31
%17 = shl i64 %16, 16
%18 = or i64 %14, %17
ret i64 %18
}

LLVM IR (-O2):
@.str = [39 x i8] c"invalid register operand when updating\00"
define i64 @insert_ras(i64 %0, i64 %1, i32 %2, i8** nocapture writeonly %3) {
%5 = icmp eq i64 %1, 0
br i1 %5, label %6, label %7
6: ; preds = %4
store i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8** %3
br label %7
7: ; preds = %6, %4
%8 = shl i64 %1, 16
%9 = and i64 %8, 2031616
%10 = or i64 %9, %0
ret i64 %10
}
/* Variables and functions */
int strlen(char *);
void strformat(char *c) { c[strlen(c) - 1] = 0x00; }


x86 assembly (clang, -O0):
<strformat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
sub    $0x1,%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strformat>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
movb   $0x0,-0x1(%rax,%rbx,1)
pop    %rbx
ret

LLVM IR (-O0):
define void @strformat(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = sub nsw i32 %5, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %3, i64 %7
store i8 0, i8* %8
ret void
}

LLVM IR (-O2):
define void @strformat(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, -1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initMatrix();
int /*<<< orphan*/ printMatrix();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rotateclockarm();
int /*<<< orphan*/ rotatespinaxis();
int main() {
  initMatrix();
  printMatrix();
  printf("Using Method 1:\n");
  rotateclockarm();
  printMatrix();
  printf("Using Method 2:\n");
  rotatespinaxis();
  printMatrix();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1070 <initMatrix@plt>
mov    $0x0,%al
call   1050 <printMatrix@plt>
lea    0xe8c(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <rotateclockarm@plt>
mov    $0x0,%al
call   1050 <printMatrix@plt>
lea    0xe83(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <rotatespinaxis@plt>
mov    $0x0,%al
call   1050 <printMatrix@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <initMatrix@plt>
xor    %eax,%eax
call   1050 <printMatrix@plt>
lea    0xe9a(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <rotateclockarm@plt>
xor    %eax,%eax
call   1050 <printMatrix@plt>
lea    0xe90(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <rotatespinaxis@plt>
xor    %eax,%eax
call   1050 <printMatrix@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Using Method 1:\0A\00"
@.str.1 = [17 x i8] c"Using Method 2:\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initMatrix()
%3 = call i32 (...) @printMatrix()
%4 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @rotateclockarm()
%6 = call i32 (...) @printMatrix()
%7 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (...) @rotatespinaxis()
%9 = call i32 (...) @printMatrix()
ret i32 0
}

LLVM IR (-O2):
@str = [16 x i8] c"Using Method 1:\00"
@str.2 = [16 x i8] c"Using Method 2:\00"
define i32 @main() {
%1 = tail call i32 (...) @initMatrix()
%2 = tail call i32 (...) @printMatrix()
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @rotateclockarm()
%5 = tail call i32 (...) @printMatrix()
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0))
%7 = tail call i32 (...) @rotatespinaxis()
%8 = tail call i32 (...) @printMatrix()
ret i32 0
}
/* Variables and functions */
int core7_safe(char const *);
int U_EMROFFSETCLIPRGN_safe(const char *record) { return (core7_safe(record)); }


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

x86 assembly (clang, -O2):
<U_EMROFFSETCLIPRGN_safe>:
jmp    1030 <core7_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMROFFSETCLIPRGN_safe(i8* %0) {
%2 = tail call i32 @core7_safe(i8* %0)
ret i32 %2
}
int isascii(int c) { return ((c >= 0) && (c <= 127)); }


x86 assembly (clang, -O0):
<isascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isascii+0x20>
cmpl   $0x7f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isascii>:
xor    %eax,%eax
cmp    $0x80,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isascii(i32 %0) {
%2 = icmp ult i32 %0, 128
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ i80186rep(int);
void i80186_repe() { i80186rep(1); }


x86 assembly (clang, -O0):
<i80186_repe>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <i80186rep@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<i80186_repe>:
mov    $0x1,%edi
jmp    1030 <i80186rep@plt>

LLVM IR (-O0):
define void @i80186_repe() {
%1 = call i32 @i80186rep(i32 1)
ret void
}

LLVM IR (-O2):
define void @i80186_repe() {
%1 = tail call i32 @i80186rep(i32 1)
ret void
}
int all_upper(str)
register char *str;
{
  while (*str) {
    if (!(((unsigned char)*str) <= 0177) || !isupper(*str))
      return 0;
    ++str;
  }
  return 1;
}


x86 assembly (clang, -O0):
<all_upper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116b <all_upper+0x5b>
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x7f,%eax
jg     114e <all_upper+0x3e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isupper@plt>
cmp    $0x0,%eax
jne    115a <all_upper+0x4a>
movl   $0x0,-0x4(%rbp)
jmp    1172 <all_upper+0x62>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    111c <all_upper+0xc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<all_upper>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
test   %al,%al
je     114b <all_upper+0x3b>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %al,%al
js     1150 <all_upper+0x40>
movzbl %al,%edi
call   1030 <isupper@plt>
test   %eax,%eax
je     1150 <all_upper+0x40>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <all_upper+0x20>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @all_upper(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %7
4: ; preds = %11
%5 = load i8, i8* %15
%6 = icmp eq i8 %5, 0
br i1 %6, label %16, label %7
7: ; preds = %1, %4
%8 = phi i8 [ %5, %4 ], [ %2, %1 ]
%9 = phi i8* [ %15, %4 ], [ %0, %1 ]
%10 = icmp sgt i8 %8, -1
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = zext i8 %8 to i32
%13 = tail call i32 @isupper(i32 %12)
%14 = icmp eq i32 %13, 0
%15 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %14, label %16, label %4
16: ; preds = %11, %7, %4, %1
%17 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %7 ], [ 0, %11 ]
ret i32 %17
}