#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int atoi(char *);
char *strchr(char *, char);
int /*<<< orphan*/ strcpy(char *, char const *);
int strlen(char const *);
int get_two_jobs(const char *str, int *j1, int *j2) {
  char tmp[50];
  char *tmp2;
  if (strlen(str) >= 50)
    return 0;
  strcpy(tmp, str);
  tmp2 = strchr(tmp, '-');
  if (tmp2 == NULL)
    return 0;
  *tmp2 = '\0';
  ++tmp2;
  *j1 = atoi(tmp);
  *j2 = atoi(tmp2);
  return 1;
}


x86 assembly (clang, -O0):
<get_two_jobs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x32,%eax
jl     1172 <get_two_jobs+0x32>
movl   $0x0,-0x4(%rbp)
jmp    11e4 <get_two_jobs+0xa4>
lea    -0x60(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
lea    -0x60(%rbp),%rdi
mov    $0x2d,%esi
call   1050 <strchr@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
jne    11a8 <get_two_jobs+0x68>
movl   $0x0,-0x4(%rbp)
jmp    11e4 <get_two_jobs+0xa4>
mov    -0x68(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x68(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x68(%rbp)
lea    -0x60(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x68(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_two_jobs>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x40,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
call   1040 <strlen@plt>
xor    %ebp,%ebp
cmp    $0x31,%eax
jg     11a6 <get_two_jobs+0x66>
mov    %rsp,%r12
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <strcpy@plt>
mov    %r12,%rdi
mov    $0x2d,%esi
call   1050 <strchr@plt>
test   %rax,%rax
je     11a6 <get_two_jobs+0x66>
mov    %rax,%rbx
movb   $0x0,(%rax)
add    $0x1,%rbx
mov    %rsp,%rdi
call   1060 <atoi@plt>
mov    %eax,(%r15)
mov    %rbx,%rdi
call   1060 <atoi@plt>
mov    %eax,(%r14)
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_two_jobs(i8* %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca [50 x i8]
%9 = alloca i8*
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
%10 = load i8*, i8** %5
%11 = call i32 @strlen(i8* %10)
%12 = icmp sge i32 %11, 50
br i1 %12, label %13, label %14
13: ; preds = %3
store i32 0, i32* %4
br label %33
14: ; preds = %3
%15 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 0
%16 = load i8*, i8** %5
%17 = call i32 @strcpy(i8* %15, i8* %16)
%18 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 0
%19 = call i8* @strchr(i8* %18, i8 signext 45)
store i8* %19, i8** %9
%20 = load i8*, i8** %9
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %23
22: ; preds = %14
store i32 0, i32* %4
br label %33
23: ; preds = %14
%24 = load i8*, i8** %9
store i8 0, i8* %24
%25 = load i8*, i8** %9
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %9
%27 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 0
%28 = call i32 @atoi(i8* %27)
%29 = load i32*, i32** %6
store i32 %28, i32* %29
%30 = load i8*, i8** %9
%31 = call i32 @atoi(i8* %30)
%32 = load i32*, i32** %7
store i32 %31, i32* %32
store i32 1, i32* %4
br label %33
33: ; preds = %23, %22, %13
%34 = load i32, i32* %4
ret i32 %34
}

LLVM IR (-O2):
define i32 @get_two_jobs(i8* %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = alloca [50 x i8]
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%6 = tail call i32 @strlen(i8* %0)
%7 = icmp sgt i32 %6, 49
br i1 %7, label %16, label %8
8: ; preds = %3
%9 = call i32 @strcpy(i8* %5, i8* %0)
%10 = call i8* @strchr(i8* %5, i8 signext 45)
%11 = icmp eq i8* %10, null
br i1 %11, label %16, label %12
12: ; preds = %8
store i8 0, i8* %10
%13 = getelementptr inbounds i8, i8* %10, i64 1
%14 = call i32 @atoi(i8* %5)
store i32 %14, i32* %1
%15 = call i32 @atoi(i8* %13)
store i32 %15, i32* %2
br label %16
16: ; preds = %8, %3, %12
%17 = phi i32 [ 1, %12 ], [ 0, %3 ], [ 0, %8 ]
ret i32 %17
}